Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Using XML Schema inline?

From: noah_mendelsohn@--.---.---
To: voss@----.-- (----- ----)
Date: 3/22/2005 9:07:00 AM
FYI, there are deeper issues here.   The XML Recommendation explicitly 
provides for DTDs.  When you put a DTD "internal subset" into a document 
it is not part of the logical element content; it is metadata, as it 
should be in most cases.
 
Consider putting a schema into a document such as a resume:

        <resume>
                <xsd:schema>
                        ...
                </xsd:schema>
                <applicant>Mary Smith</applicant>
        </resume>

There is a sense in which you have made the schema part of the resume 
which in most cases is not what you really mean.  Unfortunately, XML is 
not extensible in this dimension.  There is only one schema language that 
is allowed in a first class manner.  The XML schema group wrestled with 
lots of ways around this, but the fundamental problem remains.  Similar 
lack of pluggability explains why Schemas cannot declare Entities in a way 
that XML would understand:  the XML rec only provides for entities to be 
declared in DTDs.

Anyway, you can see why the above somewhat discourages creating a 
standardized way of embedding a schema, because you necessarily are 
impacting the content of the document.   You really need the document 
format (resume) to anticipate the existence for the <schema>.  Indeed, the 
content model for the <resume> element would have to explicitly allow for 
and either validate or skip using a wildcard the schema elements. 

I haven't looked at how Microsoft is working around this.  There are a 
variety of conventions that can be use, including:

        <container>
                <xsd:schema>
                        ...
                </xsd:schema>
                <resume>
                        <applicant>Mary Smith</applicant>
                </resume>
        </container>

but then again you are into special cases.  Note that the Schema rec does 
allow, though not all processors support, validation of subtrees.  One of 
the many reasons was so that in the container example, the schema could be 
for just the resume if you prefer, and not necessarily for the container 
as a whole.

I always thought it ironic that the XML Recommendation, which is so 
extensible in a number of important dimensions, is so rigid in some 
others.

Noah

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








voss@n... (Jonas Voss)
Sent by: xmlschema-dev-request@w...
03/22/2005 09:39 AM

 
        To:     xmlschema-dev@w...
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Re: Using XML Schema inline?



In gmane.text.xml.schema.devel, Michael Champion <mcham@m...> 
wrote:

> It's supported in the Microsoft XML tools, see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/
> html/xmconvalidationinlineschemas.asp

> AFAIK this will not interoperate (except at the XML syntax level) with
> other tools.  Inline schema support seem to be consistent with the
> various Recommendations, but not mandated by any.  FWIW,
> http://www.codeguru.com/Csharp/Csharp/cs_data/xml/article.php/c4235/
> suggests avoiding inline schemas whenever possible.

Thank you very much for your answer, I'll wave it in front of my boss,
and see what he says.

~/j

-- 
|   Jonas @ 55.75, 12.42   |

 It's just a job. Grass grows, birds fly,
 waves pound the sand. I beat people up. - Muhammed Ali, 1977.






From ANTHONY.M.HOANG@s... Wed Mar 23 01:21:03 2005
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.44)
	id 1D


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