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

RE: What's a valid instance...James Clark

From: Michael Kay <mike@saxonica.com>
Date: Thu, 22 Mar 2007 15:04:00 -0000
To: "'Shlomo Yona'" <S.Yona@F5.com>, "'Pete Cordell'" <petexmldev@tech-know-ware.com>, <xmlschema-dev@w3.org>
Message-ID: <02e801c76c93$52d91820$6401a8c0@turtle>
RE: What's a valid instance...James Clark

> Is this intentional? 

Yes. The philosophy in XML Schema is that you validate an element against
either an element declaration or a type. The problem is that in most real
products, the primary interface is "validate this document against this
schema". So it's not a restriction in the spec, it's a restriction in
product implementations (which might be attributed to the fact that the
authors of the spec didn't always have their feet firmly on the ground.)

In XSLT 2.0, if you specify 

<xsl:variable name="input" select="doc('input.xml')"
as="document-node(element(my:invoice))"/>

then the system will ensure not only that the input is valid against the
schema, but that it is valid against the my:invoice element declaration in
the schema.

Michael Kay
http://www.saxonica.com/
Received on Thursday, 22 March 2007 15:04:13 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

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-2007 All Rights Reserved.