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

filtering descendent text nodes

Subject: filtering descendent text nodes
From: Aseef Jamaluddin <j_aseef@xxxxxxxxx>
Date: Sun, 17 Mar 2002 19:09:18 -0800 (PST)
 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


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.