W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

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>

> 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')"

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
Received on Thursday, 22 March 2007 15:04:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:41 UTC