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

numbering the result tree

Subject: numbering the result tree
From: "Shlomi Sarfati" <shlomi@xxxxxxxxxx>
Date: Sun, 26 Nov 2000 15:24:05 +0200
accessing deep xml trees simplexml
hi
I have a simple xml tree like this :
<main>
	<list>
	      <objects> </objects>
	      <objects> </objects>
	      <objects> </objects>
	      <objects> </objects>
		<list>
	           <objects> </objects>
	           <objects> </objects>
	           <objects> </objects>
	           <objects> </objects>
		     <list>
	               <objects> </objects>
   	               <objects> </objects>
	               <objects> </objects>
	               <objects> </objects>
		     </list>
		</list>
	</list>
</main>
each list have its objects and other lists that can have lists that can have
lists .......
I built a simple xsl that transfer this xml to another xml but I need to
give the result tree numbers that will define the tree ! .
I need that the first list will be 1, 2, 3... N  and all the nodes under a
certain list will be X_1, X_2, X_3 ... X_N
(where x is the father number) etc.
my result tree should be unlimited in his depth (as deep as the source tree)
this is my xsl :
----------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
   <xsl:apply-templates />
</xsl:template>

<xsl:template match="main">
   <xsl:apply-templates />
</xsl:template>

<xsl:template match="list">
   <!-- this is where i need to put the number that represent the node -->
  <xsl:apply-templates/>
</xsl:template>


<xsl:template match="object">
   <!-- irrelevant  -->
	<xsl:apply-templates/>
</xsl:template>


</xsl:stylesheet>


hope I made my self clear, and thanks for the help
shlomi











 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.