[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
"Jeff Greif" <jgreif@a...> writes:

> 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).

All true, but these observations don't render the question vacuous.
First of all, it often makes sense to answer the question wrt a _schema_
(not a schema _document_), i.e. making a closed-world assumption.
This means that the substitution group and derived type problems go
away (or rather, become part of the large-but-solvable problem), and
the wildcard problem is significantly constrained.  That all adds up
to a broad class of cases where you can say definitively 'yes' or
'no', and so the answer 'maybe' for the residuum is also useful,
because you can say "maybe, but only if the (sub-)path x/y/z occurs
within the following lax-or-skip-wildcard-allowed contexts. . .".

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@c...
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]


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.
First Name
Last Name
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.