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

Re: RE: Re: RE: Re: XPath riddle

Subject: Re: RE: Re: RE: Re: XPath riddle
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 5 Jul 2001 05:28:19 -0700 (PDT)
 Re: RE: Re: RE: Re: XPath riddle
Nikolaos Giannadakis wrote:

> in the context of xml schemas, DIFFERENT element declarations with the same
> name (and possibly ancestors) may appear within different scopes. Let then
> be a recursive XML Schema definition. The problem appears when one wants to
> select specific nodes in an XML file conforming to this recursive schema. In
> particular, all other nodes (with the same name etc -but declared within
> other elements-) will be returned as well.

Now, if I understand you well, you want every D/C, for which the first ancestor from
a given list of ancestors (the list of elements defining D and its child C as
descendents) to be "A" and nothing else.

Then this is returned by:

//D/C[name(ancestor::*[name()='A' or name()='F'][1])='A']

Here I'm supposing that "A" and "F" are the only two elements, for which "D" with
child "C" have been defined in the schema.

In case there are more such elements defining D/C and their names are provided as
(e.g.) space-delimited list $listOfDefiningEls, then this more general expression
will be:

//D/C[name(ancestor::*[contains($listOfDefiningEls, concat(' ', name()))][1])='A']

Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 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.