[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Locating an attribute and its value indirectly
Thanks Ken.
That makes sense, anchoring current() to the point at which the XPath began evaluating the expression. My more naof was view was that it "returned me" to my original context no matter what. Mark -----Original Message----- From: G. Ken Holman Sent: Friday, November 04, 2011 6:27 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Locating an attribute and its value indirectly At 2011-11-04 17:05 -0700, Mark wrote: That works. I think I get it.
And your "<xsl:value-of select="../Formats/@*[name(.)=current()/@text-location]"/>" switched the path back to the current context where @text-location actually resides?
Which, in your case, is the context where @text-location resides, thus Brandon's current()/@text-location works. In other situations you may find yourself walking from that place to find another node, as in current()/../@idref I didn't want you to think current() was magic in knowing where @text-location was, it was just coincidentally attached to the element that was current at the beginning of the XPath expression evaluation. I hope this is helpful. . . . . . . . . . . Ken -- Contact us for world-wide XML consulting and instructor-led training Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/t37DVX Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|