OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Relax NG and Web Services (formerly Joining the church)

[ Lists Home | Date Index | Thread Index ]

From: "Eric van der Vlist" <vdv@dyomedea.com>
> 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
> ------------------------------------------------------------------------





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS