cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@diff.uni-tuebingen.de (Manfred Knobloch)
Subject Re: Text elements in XSLT
Date Tue, 22 Aug 2000 07:35:17 GMT
per@onclave.com schreibt:
>Why does this XSL snippet return '[Level1]',
>and not '[Level1 /Level1]' with the following data?

The text nodes seem to be treated as two separate nodes - don't ask me
why. Probably you try
this xslt code

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml"/>
	<xsl:template match="prefs">
		[<xsl:apply-templates select="text()"/>]<br/>
		<xsl:apply-templates select="prefs"/>
	</xsl:template>
	
	<xsl:template match="text()">
		<xsl:value-of select="." />
	</xsl:template>
</xsl:stylesheet>
>
>
>XSLT:
>	<xsl:template match="prefs">
>		[<xsl:value-of select="text()"/>]<br/>
>		<xsl:apply-templates select="prefs"/>
>	</xsl:template>
>
>
>Data:
>	<prefs>
>		Level1
>		<prefs>Level2</prefs>
>		/Level1
>	</prefs>
>
>According to the XSLT spec:
>"The node test text() is true for any text node. For example,
>child::text()
>will select the text node children of the context node."
>
>As I see it, the top level prefs should have three children: a text
>element
>(Level1), a child element(prefs), and another text element (/Level1).
>
>Help would be appreciated,
>Per.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>



Manfred Knobloch

Kompetenzzentrum für Multimedia und Telematik
am DIFF
Konrad Adenauer Str. 40
72072 Tübingen

tel: ++49 (0)7071 / 979 232
fax: ++49 (0)7071 / 979 322
email: manfred_knobloch@diff.uni-tuebingen.de
www: http://kmmt.diff.uni-tuebingen.de


Mime
View raw message