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

Re: Deterministic Content Models (was DTD ( From EliotteRustHa

  • From: Elliotte Rusty Harold <elharo@m...>
  • To: xml-dev <xml-dev@l...>
  • Date: Thu, 27 Sep 2001 12:23:10 -0400

sax deterministic
At 4:50 PM +0100 9/27/01, Rob Lugt wrote:


>Our XML Validator reports non-deterministic content models as errors for
>good reason.  We believe that our users want a validator to be as strict and
>as accurate as possible ~ thereby maximising the chance that their xml will
>be readable by any processor on any platform.
>

I guess the real question is how it gets reported. It is not a well-formedness error and probably should not be reported as one. On the other hand, parsers aren't required to recover from this error either so a parser is within its rights to give up here or not. Yuck. 

In terms of SAX, clearly this should be reported through the error() method in the ErrorHandler class which matches this case (recoverable error) exactly. http://sax.sourceforge.net/apidoc/org/xml/sax/ErrorHandler.html#error(org.xml.sax.SAXParseException)

The next question is what to do if you've got a higher level API that's asking whether a document using a  non-deterministic content model is well-formed and or valid. I think in both cases the answer must be yes, such a document is both well-formed and valid (assuming of course all the other usual rules are satisfied.) There's  nothing in the XML spec to indicate that this is a violation of either well-formedness or validity. Despite this error, a document can satisfy all well-formedness and validity rules. In other words, we've uncovered a class of documents which are technically "in error" while nonetheless being well-formed and valid. Double yuck. 
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@m... | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+

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.