OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] XQuery and DTD/Schema?

[ Lists Home | Date Index | Thread Index ]

At 06:51 PM 7/2/2002 -0400, Betty Harvey wrote:

>I haven't been following the progress of XQuery closely.  I was advised
>today that a W3C Schema had to be developed instead of a DTD because
>XQuery only works with Schema.

XQuery works with well-formed documents, DTD-governed documents, or XML 
Schema-governed documents. I think the following quote from the Data Model 
draft is clear and straightforward on this subject:

 From http://www.w3.org/TR/query-datamodel/#psv:

>3.3 XML Schemas and the XML Information Set
>The data model supports the following classes of XML documents:
>1. Schema-validated documents, i.e., those validated with respect to a
>2. DTD-valid documents, i.e., those documents validated with respect
>to a DTD, and
>3. Well-formed documents with no corresponding DTD or schema.

The mappings from DTDs and well-formed documents to the equivalent schema 
documents are not yet finished, as editorial notes in the Data Model 
document point out.

As you note, XQuery does not define a mapping for RELAX-NG. This is also an 
issue for relational data, object data, or any other kind of typed data 
that is not actually an XML file governed by a schema. To make XQuery work 
for these data sources, you must define a mapping, either to the PSVI or 
directly to the XML Query and XPath Data Model. For relational sources, 
this is done by SQL/XML, a specification being developed by ISO/ANSI [1], 
which defines the mapping in terms of equivalent XML schemas and documents.

To my knowledge, nobody has done this for RELAX-NG. Anybody who wants to do 
such a mapping will need to think about how to match the purely structural 
typing of RELAX-NG to the named typing used in XQuery.


[1]  Relevant SQL/XML specs:

       The XML Data type and Publishing Functions:

       Table Mapping:

       Mapping non-predefined data types:


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS