[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] better way to get the path to a node?
Greetings -- If I want to return the XPath path to a specific node when that node is the context node, is there a better way than: <xsl:sequence select="string-join(ancestor-or-self::*/concat('/',name(),'[',for $x in . return count(preceding-sibling::*[name() eq $x/name()])+1,']'),'')"/> "Better" here means "more efficient"; I'll be using various Saxon 9.* for this, either in oXygen or from java. I keep thinking there's a way to do this without the combination of count() and preceding-sibling, but what it might be eludes me. Thanks! Graydon
|
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
|