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

Re: Relax NG and Web Services (formerly Joining the church)


eric van der vlist ambiguity
From: "Eric van der Vlist" <vdv@d...>
> Getting clear error messages is probably one of the trickiest issues I
> have in my Relax NG implementation and I actually find that Jing is doing
> a very good job.

I agree on both counts. Good error messages don't just fall off the tree
into one's basket, and jing's error messages get better all the time.

> In the specific case reported by Tim Bray, given the flexibility of Relax
> NG (and the fact that ambiguity is allowed), that can be quite challenging
> to say why (or how) an element is incomplete.

Really? An element is incomplete because something required wasn't
specified. The things that were required, either data or elements, are
members of the First set of the pattern at the point just before the error
was detected. (More specifically, they are members of the First set that had
no epsilon alternative. These are easy to extract with a visitor.) With some
case analysis and massaging, this information can improve the error message.

I don't see how ambiguity adds any difficulty except the need for duplicate
removal (the "set" in First set).

> I'd like to submit not a bug but a feature request, then.
>
> I think that there are cases where it could help if people were able to
> specify customed error messages to be raised when a pattern isn't matched,
> for instance:
> <element name="foo">
>   <attribute name="bar">
>     <data type="xsd:date">
>      <er:message>The content of the "bar" attribute should have a format
>      "YYYY:MM:DD"</er:message>    </data>
>     <er:message>Hmmm... once again, you've forgotten the "bar"
>     attribute!</er:message>  </attribute>
> </element>
>
> This would allow to add application oriented error messages more readable
> to the end user than the generic error messages given by a schema
> processor and give some of the expressive power of Schematron's error
> messages to other schema languages.

A good idea, but it doesn't excuse a model-driven validator from
automatically producing decent error messages.

Bob

> Note that this idea does also apply to other schema languages:
>
> http://lists.w3.org/Archives/Public/xmlschema-dev/2001Oct/0287.html
>
> Eric
> --
> Freelance consulting and training.
>                                             http://dyomedea.com/english/
> ------------------------------------------------------------------------
> Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
> (W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
> ------------------------------------------------------------------------


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.