Re: [xml] validate by schema works but only after reparsing ?



On Fri, Jul 04, 2003 at 11:24:05AM +0200, Peter Sobisch wrote:
Hi,

I studied the testSchema.c file and write my own program for schema validation.
If I try to validate the xml-Doc (xmlSchemaValidateDoc) I get rc=10
(XML_SCHEMAS_ERR_ELEMCONT) but, if if write the doc out (xmlSaveFormatFile)
and parse it again (xmlParseFile) the validation is successful (rc=0).

  First W3C XML Schemas implementation is known to be incomplete
so it comes with no garantees at all (except the garantee that it's
broken for the Structure part !).
  Second I have no idea why serializing and reparsing would change
the way the regular expression check for the content model work.
I think there is something else going on. I see no other way than
you debugging the code, deconstructing your sequence of modification
to the document until you find out why or where this fails starting
from the point which works. That's just debugging skills, start from
a document which validate and modify it and reintroduce your modification
code until you find out where this breaks ... Again it's just debugging
of your code, maybe there is an underlying error in the library, that
will allow to pinpoint it too ...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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