[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to select an attribute on the current node or
You guys are amazingly quick! Thanks a lot! Lets see if the old msxml on Windows CE 6.0 understands that :) Phil On Fri, Apr 15, 2011 at 10:26 AM, Michael Kay <mike@xxxxxxxxxxxx> wrote: > On 15/04/2011 07:33, Brandon Ibach wrote: >> >> ancestor-or-self::*[@data][1]/@data >> >> > Or if you prefer, (ancestor-or-self::*/@data)[last()] > > Michael Kay > Saxonica > >> >> On Fri, Apr 15, 2011 at 2:06 AM, Philipp Kursawe<phil.kursawe@xxxxxxxxx> >> B wrote: >>> >>> Hello, >>> >>> given the following xml: >>> >>> <node data="foo"> >>> B <text id="1" data="bar"/> >>> B <text id="2"/> >>> </node> >>> >>> I would like to know the XPath expression to select @data which >>> results in "bar" for @id=1 and "foo" for @id=2. >>> >>> The general idea is to search for the attribute in the anchestor if >>> the current node does not contain the attribute all the way up to the >>> root node. >>> >>> Thanks for your help! >>> >>> Phil
|
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
|