Re: [xml] Schema validity failure for valid document



Hi and a happy new year,

On Mon, Jan 03, 2005 at 08:11:17AM -0500, Scott Lawrence wrote:
xerces-c validation routines returned:

Error at file
/home/lawrence/Work/libxml2/build/tmp/call_event_examples.xml, line 18,
char 12
  Message: Element 'from' is not valid for content model:
'((dialog,to),from)'.  

The xmllint error:

call_event_examples.xml:3: element call_event: Schemas validity error
:
Element 'call_event' [CT local]: The element content is not valid.

isn't really informative enough (or wasn't for me, at least).


Please have a look at [1] - the element content for <call_event> was
not correct as well in your example instance.

  well, at the time of the error, all libxml2 had left from the Schemas
content model is a compiled automata. Sometimes that automata can be
reserialized as a string making sense to a human, we don't have an API for

This would be great!

this (yet that could be added). It's also sometime hard to find out what
exactly generated the error, seems the content model wrong is for an
element
starting line 3 but the error shows up line 18.

The example instance was indeed in error before line 18, as described in
[1].

  Error reporting can certainly be improved, but it's usually not trivial
to
provide back the "useful" information.

xmlschemas.c rev. 1.92 does not report "The element content is not valid" 
any more. It explicitely reports an unexpected element + reports 
"Missing child element(s)", if not all expected child elements are found;
but this has the (fixable) limitation described in [1].

[1] http://mail.gnome.org/archives/xml/2005-January/msg00005.html

Greetings,

Kasimier



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]