RE: [xmlschema-dev] <none>

> > By the way, we are also sometimes asked why you can't have 
> > the equivalent of a DTD internal subset, I.e. putting a 
> > schema fragment in the XML file but outside of the document 
> > element tree, and the answer is similar:  XML is not 
> > extensible in that way either.  The only "schema" language 
> > that can be embedded as an internal subset in an XML document 
> > is a DTD.
> 
> I've never seen anything in the spec that stops you embedding a schema
> document within the source document to be validated, and referring to it 
as
> say xsi:noNamespaceSchemaLocation="#schema". Where is this rule?

I didn't say there was something that prevents you from embedding a schema 
within the source tree to be validated.  As you say, it can be done, 
though there might be some ambiguity about whether a given processor will 
honor the location hint as you propose.   Indeed, people do this 
occasionally and it's sometimes useful.

What I did say is that you can't put a schema where the internal subset 
is, which is outside of the tree of elements.  When the schema is in the 
element tree, then it becomes part of the logical content of the document. 
 If you're validating from the root, then the schema has to validate or at 
least allow for its own presence.  If you write another schema, perhaps in 
RelaxNG or or Schematron, then that too has to allow for the presence of 
the xsd:schema element.  So, my point was that you have with DTDs an 
important ability to put your constraints where I believe they properly 
belong, which is as metadata for the element tree rather than as part of 
it.

Altogther, I'm less enthusiastic about including schemas in content than 
some other people seem to be.  I do agree that there are certain specific 
scenarios, particularly when the root is some sort of container such as a 
SOAP envelope, where it can make sense.  In general, if I have some 
application-specific XML tree such as an encoded work of music, a purchase 
order, etc., then I'm not convinced that an xsd:schema logically belongs 
as a descendent of the root element.

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Thursday, 11 May 2006 00:09:36 UTC