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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RELAX NG and the XQuery/XPath 2.0 data model

[ Lists Home | Date Index | Thread Index ]

From: "Bob Foster" <bob@objfac.com>
> I know I have trouble understanding 3.6 and I expect others do. If an
> element's complex type is not a named type, like nested declarations in
XML
> Schema and _all_ DTD (or RELAX NG) complex types, what path through this
> guarantees that a) the actual complex type will be used to determine
> validity of the content model and b) the proper simple types will be
> assigned to attributes and elements?

It's the weekend, and after my last rant no one may be speaking to me, so I
may as well try to answer myself. ;-}

Actually, the data model spec seems very well-written and is a fairly easy
read. Hats off to the editors. The spec is so readable in the main that one
is lulled into believing that one actually understands it, right up to
section 3.6, which is largely written in pseudo-code and provides no links
to the many bracketed terms, on which the meaning depends. I don't know what
the standards are for last call documents, but links to definitions might
help reviewers.

The specific point that I wanted to understand, which all the hoopla about
strong typing and, in particular, named typing had led me worry about, was
whether this emphasis had effectively ruled out the use of DTDs or RELAX NG
schemas with XQuery or XSLT 2.0? Assuming some implementation provided
support for RELAX NG, how conformant could it be? Fortunately, it seems the
section that answers this question is 3.4.

Anonymous complex types, which can appear in XML Schema and are the only
kind available in DTD or RELAX NG, are dealt with by assigning each an
implementation-defined, globally unique anonymous type name. Such a type is
therefore not equivalent to any other type and for DTD or RELAX NG complex
types would be derived by restriction from xs:anyType. (Actually, I don't
see where the data model spec says that, but it is in the formal semantics
spec.)

Thus, DTD or RELAX NG complex types should work with the data model about as
well as could be expected, or even desired. One would suppose that the XML
Schema datatypes RELAX NG offers as an option could be made compatible with
the data model, as well. (RELAX NG has two additional primitive types,
string and token, which can be mapped to xs:string and xs:token.)

So any problems RELAX NG schemas might have with XQuery/XPath 2.0, they
probably are not found in the data model. Someone has obviously been careful
to ensure that XML Schema is not necessarily the only game in town. Good
job.









 

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

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