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

RE: accessing CDATA from XSL

Subject: RE: accessing CDATA from XSL
From: "Conal Tuohy" <conalt@xxxxxxxxxxxxxxx>
Date: Tue, 24 Dec 2002 10:57:14 +1300
cdata xslt
> Conal Tuohy wrote:
> > <xsl:value-of select="text()"/> will return the text of the
> > parent element, without including the text of the <child>
> > element.
>
> The select identifies the node-set consisting of those text
> nodes, yes, but using value-of on a node-set will result in
> the use of the string-value of just the first node in the
> set.

Yes I tend to forget the implicit "[1]" in <xsl:value-of>.

It seemed to me that Mukund's original example was contrived (e.g. a child
called "child") and I was trying to propose a general solution for what I
was guessing Mukund might want to do (possibly multiple children, for
instance). I guess what I was really trying to say was something like:

<xsl:for-each select="text()"><xsl:value-of select="."/></xsl:for-each>

or even

<xsl:for-each select="text()[normalize-space(.)]"><xsl:value-of
select="."/></xsl:for-each>

But actually I think the real answer Mukund was looking for was that the
CDATA section AS SUCH is not accessible in XSLT ... it's just merged with
other text data.

Cheers!

Con


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