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

Re: XML Schema considered harmful?


xml schema global elements
> >From point 7:
>
> "In W3C XML Schema there is no way to specify what is allowed as the
> root element."
>
>
> I've probably completely missed the point here, but doesn't an XML Schema
> that only has one global element achieve the above? Maybe its a matter of
> semantics but that's how it's panned out in practice for me thus far.

Yes and no.  One of the several methods that parsers are allowed to use to
validate a document is by finding a global element declaration for the root
element.  If your parser is using this method, then a side-effect of having
only one global element declaration is that your parser will not be able to
validate the document if your root element does not match that global
element declaration. However, I think this is a workaround to a missing
feature, not (as far as I can tell) the intended use of global element
declarations.  And it has a significant cost: since element substitution
groups only work for global elements, if you adopt this workaround, you
effectively lose XML Schema's element substitution group feature.  For this
reason, many schemas use global element declarations for elements that
cannot be root elements. One example is the XML Schema schema for XML
Schemas.  The net result is that, simply by examining an XML Schema, I
cannot tell which elements are intended to be allowed as root elements.

> James is emphatic, and that is only natural, but his arguments paint
> issues as black and white (XML Schema = bad, RELAX NG = good) and my
> experience with XML Schema suggests shades of grey.

I won't attempt to deny that my perspective on the relative merits of RELAX
NG and XML Schema is highly biased!

James



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.