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

XPath Problem.

Subject: XPath Problem.
From: Sandeep_Karandikar@xxxxxxxx
Date: Wed, 8 Jan 2003 13:51:20 -0600
parsing xpath
Hello All,

I have a wierd problem parsing the following XML data.

<RootNode>
<DInfo name="D1">
	<TInfo name="t1"></T1>
	<TInfo name="t2"></T2>
</DInfo>
<DInfo name="D2">
	<DInfo name="D3">
		<TInfo name="t1"></T1>
		<TInfo name="t2"></T2>
	</DInfo>
	<DInfo name="D4">
		<DInfo name="D5">
			<TInfo name="t3"></T1>
			<TInfo name="t4"></T2>
		</DInfo>
		<DInfo name="D6">
			<TInfo name="t3"></T1>
			<TInfo name="t4"></T2>
		</DInfo>
	</DInfo>
</DInfo>
</RootNode>

Required Output:-
	<xsl:key name="TInfo-Key-By-Name" match="TInfo" use="@name"/>
	
	<xsl:for-each
select="TInfo[count(.|key('TInfo-Key-By-Name',@name)[1]) = 1]"> 
		<xsl:call-template name="ShowTInfo">
	</xsl:for-each>
1. So when I have the RootNode Selected this works correctly and displays me
t1, t2, t3 , t4  only once.

2. When I am on <DInfo name="D2"> I need to display t1, t2, t3, t4. However
only t3 and t4 get displayed since it thinks that t1 and t2 have already
been displayed.

Not sure what I am missing here...!

Thanks
Sandeep.



 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.