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

Re: XPath validation against a schema rather that against an


xpath validation
Actually, owing to the possibility of wildcards, substitutions and derived
types outside a given schema, you cannot even do the particular test
mentioned below.

In schema for namespace A, we define element ea, which does not forbid
itself from being the head of a substitution group.  In schema for namespace
B, we define element eb which declares itself to be in the substitution
group headed by A:ea (satisfying the appropriate conditions on the types of
eb and ea).  Then in an instance conforming to schema A, we might find B:eb
where A:ea is declared to occur.   Checking the xpath //B:eb against schema
A will not be very useful.  Validating against schema B would be better, but
would be non-trivial.  Given a document with a root of  A:x, you're not
always going to know which of the other namespaces it declares is the right
one to validate some xpath against.

If schema A declares type ta and schema B extends this type by adding the
element foo and calling the type tb, then an instance document conforming to
a type ta can actually contain the content of tb, and hence a foo element.

Of course, the moment wildcards (types, elements or attributes) are used, an
xpath that descends into the subtree of the document replacing the wildcard
can contain anything (subject to the namespace constraints).

Jeff


----- Original Message -----
From: "Sean McGrath" <sean.mcgrath@p...>
To: <xml-dev@l...>
Sent: Monday, January 13, 2003 11:47 PM
Subject:  XPath validation against a schema rather that against an
instance


> Heres a question I was asked today which struck me:
>
> >Is there any way I can validate a XPATH against a XML Schema (and not
> >against the XML document)
>
> I don't know of anything like this. I can see why it would be a useful
static
> sanity check of XPath usage in some contexts. I.e. "warning: //foo can
never
> match in schema XXX because there is no 'foo'".



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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.