[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] numbering the result tree
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|