[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

selecting a element without it's child element

Subject: selecting a element without it's child element
From: <srinivasan.p@xxxxxxxxxx>
Date: Wed, 10 Nov 2010 15:37:29 +0530
 selecting a element without it's child element
Hi Experts,

I need to select an element and store in a variable, but not the child
element of that particular element.

My XML

<book><title><indexterm>Violent Extremism</indexterm> Sacred Values, and
what it Means to be Human</title></book>

My XSLT:

<xsl:variable name="filename"><xsl:value-of select="book/title except
child::indexterm"/></xsl:variable>

<xsl:template match="/">
<xsl:message><xsl:value-of select="$filename"/></xsl:message>
</xsl:template>

My Current output:

Violent ExtremismSacred Values, and what it Means to be Human

My Expected output:

Sacred Values, and what it Means to be Human

The content of "indexterm" element should not be part of the file name. I
need to ignore that element while selecting the title element.

Can you please give me the solution for this? I am not sure if I am using in
the right way of "except" expression.

I am using XSLT 2.0 and Saxon.

Thanks
Srinivasan
 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.