This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

filtering descendent text nodes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]