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

RE: generate full xpath name to an attribute?

Subject: RE: generate full xpath name to an attribute?
From: Ray Tayek <rtayek@xxxxxxxxx>
Date: Mon, 31 Mar 2003 09:12:32 -0800
xpath independent namespaces name text
At 05:36 PM 3/31/03 +0100, you wrote:
> yikes! - looks like the simplest way is to have:
>
> <xsl:template match="name">
>         <xsl:for-each select="ancestor-of-self::*">
>           <xsl:value-of select="name()" /><xsl:text>/</xsl:text>
>         </xsl:for-each>
>         <xsl:value-of select="." />
>       </xsl:template>
>

That won't work if you want to generate a path that's independent of the
namespace context.

true


 If you want the path expression to be
context-independent then you need to generate steps of the form

*[local-name()='x' and namespace-uri()='y']

you lost me there. i can assume that there will be only one namespace in use or none for my case,.



Also, the code above generates a path such as a/b/c/d which will select
many elements, whereas you probably want one that selects a single
element such as a[3]/b[2]/c[89]/d[1].

yes, i do have arrays and will want to solve that problem. but i could use number on the names of the elements perhaps?


 But in this case the "tumbler"
path of the form *[23]/*[2]/*[17] is simpler, and avoids namespace
problems entirely.

i need to know the names, because i need to know what i am doing when i process the elements. the xpath names will be he values of name attributes in an html form.



As you see, there are multiple solutions to this requirement - which is
because there are actually a number of different requirements. This is
why there is no standard function.....

i can see this.


is there any way to get at it using type(), like test="type()='ENTITY") or something like that?

thanks

---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/


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.