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

Re: getting text nodes of subtree?

Subject: Re: getting text nodes of subtree?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 28 Jun 2002 12:28:55 +0100
getting text element node
Hi Jarkko,

> This one nearly does it.
[snip]
> <xsl:value-of select = "//a" >
> <xsl:value-of select = "text()" /> 
> </xsl:value-of>
> 
> <xsl:value-of select = "a/child::*"> 
> <xsl:value-of select = "text()" /> 
> </xsl:value-of>
> 
> <xsl:value-of select = "b/child::*"> 
> <xsl:value-of select = "text()" /> 
> </xsl:value-of>

Really? It should give you an error -- you're not allowed to have
xsl:value-of elements inside other xsl:value-of elements. Perhaps
you're using xsl:for-each instead? In that case, you'd get the value
of the first text node child of each of the a elements in the
document, followed by the first text node child of each of the
elements that are children of the 'a' document element, followed by
the first text node child of each of the elements that are children of
the 'b' document element. (The reason you get only the *first* text
node child of the element is that xsl:value-of picks the first node
from the node set you select with its select attribute, and gives the
string value of that.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2007 All Rights Reserved.