Subject: Re: [xsl] extract xpath locator From: Nicolas Mazziotta <nicolas.mazziotta@xxxxxxxxx> Date: Thu, 12 Aug 2004 13:40:30 +0200 |
I works! Thanks a lot for the fast answer. Sorry it was in the archive. N. Mazziotta On Thu, 12 Aug 2004 10:25:27 +0100 David Carlisle <davidc@xxxxxxxxx> wrote: > > The archives of this list (and possibly the faq) have a very complete > implementation of this from Dimitre if I recall that handles all kinds > of nodes, comments text etc, but basically you want to use > [<xsl:value-of > select="1+count($node/preceding-sibling::*[local-name(.)=local-name($node) > and namespace-uri(.)= and namespace-uri($node)])"/>] > > or simpler don't write out > <xsl:value-of select="name($node)"> > just write out a * > then you can do > [<xsl:value-of > select="1+count($node/preceding-sibling::*)"/>] > > ie produce > > /*[1]/*[2] > > rather than > "/doc/i[2]". > > > > I have tried to "count(preceding-sibling::$name)" > > You can never use a variable to hold a bit of Xpath syntax, this would > be like having x="+ 2" in C and hoping that 1 x was a) legal and b) > evaluated to 3. Variables can only be bound to values. > > David > > > ________________________________________________________________________ > This e-mail has been scanned for all viruses by Star Internet. The > service is powered by MessageLabs. For more information on a proactive > anti-virus service working around the clock, around the globe, visit: > http://www.star.net.uk > ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] extract xpath locator, David Carlisle | Thread | [xsl] Need exactly 23 rows of outpu, Clay Leeds |
RE: [xsl] XSLT 2.0 : Unicode hex no, Michael Kay | Date | Re: [xsl] recursivity and param, Dimtre Novatchev |
Month |