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

RE: Apostrification -- Re: Generating XPath expression

Subject: RE: Apostrification -- Re: Generating XPath expressions
From: "Charlie McCay" <Charlie@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 5 Apr 2001 14:21:39 +0100
charlie mccay
Richard

The following from Francis Norton may be what you are looking for -- I
couldn't find it in the archive -- hence the re-copy to the list

All the best

Charlie

Charlie McCay, charlie@xxxxxxxxxxxxxxxxxxx


> I'm trying to produce which is som debugging
> message that generates and X-Path to the problem
>


> From: Francis Norton [mailto:francis@xxxxxxxxxxx]
> Sent: 12 December 2000 14:17
> Subject: Re: Generating XPath expressions
>
>
> Try this ...
>
> <xsl:template name="mypath">
>   <xsl:for-each select="(ancestor-or-self::*|@*)">
>     <xsl:choose>
>       <xsl:when test=". = /"/>
>       <xsl:otherwise>/<xsl:value-of select=
> 	"concat(name(.), '[',
> count(preceding-sibling::*[name(current()) =
> name(.)]) + 1, ']')"
> 					/>
>       </xsl:otherwise>
>     </xsl:choose>
>   </xsl:for-each>
> </xsl:template>
>
> ... for an elements-only solution in XSLT, that generates
> "/a[1]/b[3]/c[1]" style xpath for any given context node.
>
> Francis.


 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.