[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: selecting a element without it's child element
On 10/11/2010 10:07, srinivasan.p@xxxxxxxxxx wrote:
Hi Experts, Use <xsl:variable name="filename" select="book/title"/> Your code is wrong at several levels. book/title selects a single node which is a title element; removing nodes called indexterm from that set is a no-op because there aren't any. Then you are doing xsl:value-of which takes the string value of the book/title node, which is defined as the concatenation of its descendant text nodes. You said you wanted the variable to contain the element, not to contain its string value. My Current output: Use apply-templates to do a recursive descent of the tree rooted at the title element. When you hit the indexterm element, don't descend down that branch: <xsl:template match="title"> <xsl:apply-templates/> </xsl:template> <xsl:template match="indexterm"/> Michael Kay Saxonica
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|