This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: getting text nodes of subtree?
- From: "James Fuller" <james dot fuller at o-idev dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 28 Jun 2002 11:57:23 +0100
- Subject: Re: [xsl] getting text nodes of subtree?
- Organization: o-iDeveloper ltd.
- References: <OF644457FA.8C9F10DF-ONC2256BE6.0038B35F@e-know.net>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Jakub,
here is method that illustrates what you need to do
<xsl:template match="/">
<xsl:variable name="test" select="*"/>
<xsl:value-of select="normalize-space($test)"/>
</xsl:template>
there are so many ways of doing this;
- //text() will select all text nodes for you in the entire tree
- how do you want to handle whitespace ? use normalize-space() and possibly
translate depending on what whitespace chars or present
goto www.dpawson.co.uk the XSLT FAQ for more info
good luck, jim fuller
----- Original Message -----
From: <Jakub.Valenta@Deio.net>
To: <XSL-List@lists.mulberrytech.com>
Sent: Friday, June 28, 2002 11:29 AM
Subject: [xsl] getting text nodes of subtree?
> Hi all,
> how can I get string which contains text nodes of all children of given
> element?
>
> for example what will return
>
> <a>
> aaa
> <b>
> bbb
> <c>
> ccc
> </c>
> BBB
> </b>
> AAA
> </a>
>
> aaabbbcccBBBAAA
>
> br,
>
> Jakub
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list