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

An issue?: Parsers with XML Schema support & reporting errors ininvalid

  • From: Dylan Walsh <Dylan.Walsh@K...>
  • To: Xml-Dev <xml-dev@l...>
  • Date: Thu, 12 Oct 2000 10:17:18 +0100

xml schema violation
While researching XML Schemas, I have small concern regarding an issue that
could effect developers of applications that use schemas & supporting
parsers to validate XML. One difference between schemas and DTDs is that
schemas can express powerful constraints on the text content of elements, or
attribute values. This power is especially useful to people using XML for
data centric, rather than document centric applications. As schemas can
express more forms of constraints than DTDs, the range of potential errors
in a parsed document is greater.

Let's say, for example, that we are using a Java parser. Errors in the XML,
where it fails to meet the constraints in the schema, would typically be
reported by throwing an exception. The form of that exception for a
particular form of schema violation is outside of the specs, they just say
whether the document should be deemed valid or not (correct me if I'm
wrong). 
Certain applications would need to know the precise reason for an XML
documents failures to validate, for example, to generate a user-friendly
error message for the user.

Therefore such an application would be closely coupled to particular form of
error reporting of the particular parser used. For example, Xerces appears
to put a descriptive text into the SAXParseException message, e.g. something
like "X is not allowed in Y". The application would need to "parse" the
parser error messages (no pun intended). Doing this could be difficult, and
switching parsers would involve a lot of recoding.

Perhaps there is a need for a formal or ad hoc standard for this reporting,
e.g. an extension to SAX, that specifies subclasses of SAXParseException for
different schema errors. Or is this already being dealt with?

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.