Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Defining recursive elements?

From: "Michael Kay" <mike@--------.--->
To: "'Todd Moon'" <tmrfcm@-----.--->, <xmlschema-dev@--.--->
Date: 5/18/2007 12:18:00 AM
> With global definitions some documents will be valid that you might 
> not want, for example an XML document of just <header/> 
> would validate using that schema.

I think it's a mistake to make elements local simply because you think there
will never be a requirement to use them as a validation root. In principle a
schema validator should give you the opportunity to say what element
declaration you want to validate against when you invoke validation.
Admittedly not all products offer that ability (Saxon doesn't, except via
some very low level API calls, until the next release), but they should. In
the meantime it's not really that hard to apply two conditions: (a) the
document must be valid, and (b) its outermost element must be X.

Again, once you start using schema-aware queries and stylesheets you find
yourself validating at a much finer level of granularity, and if you haven't
left that possibility open in the schema, then you're constrained. In XSLT
you can always validate against a global type instead, but even that option
isn't available in XQuery.

Michael Kay
http://www.saxonica.com/


From mike@s... Thu May 17 22:23:34 2007
Received: fro


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent