Re: [xml] Schema validity failure for valid document

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).

  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 (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.
  Error reporting can certainly be improved, but it's usually not trivial to
provide back the "useful" information.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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