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

Re: relative . not working in complex xpath

Subject: Re: relative . not working in complex xpath
From: "Philipp Kursawe phil.kursawe@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jul 2014 16:42:37 -0000
Re:  relative . not working in complex xpath
Ah I see. Unfortunately MS still offers no XPath2 or XQuery in its msxml
system components in Win8.1. Seems to me they have abandoned the format
long ago.


On Mon, Jul 21, 2014 at 1:01 PM, mike@xxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> "." within a predicate refers to the node that the predicate is being
> applied to, so the context item for ./xs:extension is the same as the
> context node for @name.
>
> If you're using XSLT you can often get arround this using the current()
> function. In pure XPath 1.0, join queries like this are difficult and not
> always possible. Switch to XPath 2.0 or XQuery if possible.
>
>
>
> Michael Kay
>
> Saxonica
>
>
>
> > I have selected an element from an XSD file and want to find its base
> > class
> > to accumulate all xs:attributes.
> > So I first select the node in question with
> > //xs:complexType[@name='SomeType']
> >
> > Then I want to go on from there and collect all xs:attribute
> > node.selectNodesNS(".//xs:attribute |
> > //xs:complexType[@name=./xs:extension/@base]/@name]//xs:attribute", xsns)
> >
> > Unfortunately that only gives me the attributes of the "node" I perform
> > the
> > select from.
> > I get the correct results if I explicitly use the node in my query,
> > instead
> > of the relative expression of "." in "@name=./xs:extension/@base" like
> > this:
> >
> > node.selectNodesNS(".//xs:attribute | //xs:complexType[@name =
> >
> //xs:element[@type=//xs:complexType[@name='SomeType']//xs:extension/@base]/@name]//xs:attribute",
> > xsns)
> >
> > What is going on here?
> > Using XPath 1.0 with MSXML.
> >
> > Thanks!
> >
>   XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <-list/758629> (by
> email <>)

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.