This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
filtering descendent text nodes
- From: Aseef Jamaluddin <j_aseef at yahoo dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Sun, 17 Mar 2002 19:09:18 -0800 (PST)
- Subject: [xsl] filtering descendent text nodes
- Reply-to: xsl-list at lists dot mulberrytech dot com
hi,
i am new to xslt. Given below is the files i am using.
<?xml version="1.0" ?>
<custdet>
<customer>
<name>
<firstname>FIRST1</firstname>
<secondname>NAME1
<secondname1>SECONDNAME1</secondname1>
</secondname>
</name>
</customer>
</custdet>
-------------------
I AM TRYING TO FILTER OUT ALL DESCENDENT TEXT NODES
VALUES (I.E. FIRST1,NAME1,SECONDNAME1) AND AM USING
THE FOLLOWING XSL FOR THAT.
-------------------
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
<xsl:apply-templates/>
</xsl:template>
<!-- -->
<xsl:template match="customer//node()">
First Name :
<b><i>
<font color="red">
<xsl:value-of select="." />
<br/>
</font>
</i></b>
</xsl:template>
<!---->
</xsl:stylesheet>
THE expected result is three lines with "FIRST NAME:"
prefix and the corresponding text value attached. The
output i am getting is as follows
First Name :
First Name : FIRST1 NAME1 SECONDNAME1
First Name :
First Name : 20one1
First Name
Could somebody explain what actually is happening and
also some light on the difference between child nodes
and descendent nodes.
Thanks
Aseef.J
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list