[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RELAX NG and the XQuery/XPath 2.0 data model


xpath complex type
From: "Bob Foster" <bob@o...>
> 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.






PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.