[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How can I get the XPATH of the current node ?
First of all, thanks a lot to J?g for pointing me to the Muenchian method.Relentlessly learning. I have another question : I would like to get the Xpath value of the current node. I am done some homework and tried this method suggested by Jeni Tennison : ?To get an XPath that's guaranteed to be unique, you need to use the index of the element within its parent rather than its attributevalues. An easy way is to use recursion with the ancestor-or-self axis: <xsl:for-each select="ancestor-or-self::*"> <xsl:text />/<xsl:value-of select="name()" /> <xsl:text />[<xsl:number />]<xsl:text /> </xsl:for-each> Cheers, Jeni ? Unfortunately, this does not print any number between the square brackets (with Xalan). I thought of adding value="position()", but this would be the position within this context (the for-each), not very useful. Any suggestion to solve what would be useful debugging information (in my case) ? Thanks Louis -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup "Free price comparison tool gives you the best prices and cash back!" http://www.bestbuyfinder.com/download.htm 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
|