Altova Mailing List Archives


Re: internal schema?

From: "C. M. Sperberg-McQueen" <cmsmcq@---.--->
To: nagarajank@------.---
Date: 12/14/2005 12:30:00 AM
On Fri, 2005-12-09 at 04:03, Nagarajan K wrote:

>          In dtd we can have internal or external
>          type. What about schema. But schema is xml
>          document . can we have internal schema

In principle, yes.  The XML Schema 1.0 spec does not
constrain the set of locations where a processor can
look for schema documents, and carrying both a
payload to be validated and a set of schema documents
which describe it in the same XML envelope is certainly
legal.

In practice, there are a few complications:

1 Since the spec does not constrain how processors look
for schema documents, no processor is required to
understand any particular URI scheme or way of
referring to schema documents.

2 To point at inline schemas, you'll probably want to
use URIs which use fragment identifiers.  The official
definition of frgragment identifiers for XML documents
lags behind current practice by several years; although
many XML processors understand bare-name fragment
identifiers to refer to IDs, I am not sure whether the
relevant IETF documents actually require this.

And of course ID attributes can only be declared in a
DTD, and the designers of SOAP have decided that DTDs
must not be used in SOAP messages, so if you are
planning to use SOAP, you are in a bind.  

3 Normally, one would want to use inline schemas on
just the payload, not on the entire XML document.  From
the point of the view of the XML Schema 1.0 spec, this
is not a problem.  In practice, though, some schema
processors will only start schema validation at the
root of the XML document, and there is in any case no
standard way of telling them to start anywhere else.

4 Different processors which do support inline schemas
have different ways of finding them and allowing the
user to specify at invocation time that they should be
used.  It's been a long time since I looked into this,
but my recollection is that some processors required
points of one form, others required a different
(incompatible) form, and one processor simply assumed
that any schema document (i.e. xsd:schema element) in
the XML document should be used.

There was an attempt a couple of years ago to persuade
the XML Schema Working Group to form a task force to
investigate what current processors do and write a
short Note describing current practice (and possibly
recommending some common practice, if the WG could
agree on what to recommend), but some WG members
opposed any such Note and the idea went nowhere.


I hope this helps.

-C. M. Sperberg-McQueen






From noah_mendelsohn@u... Wed Dec 14 15:38:01 2005
Received: from aji.w3.org ([133.27.228.225]

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.