Re: [xml] validation discrepency

On Mon, Dec 01, 2003 at 08:14:29AM -0800, T A wrote:
I have been working with the libxml coding examples, parser2.c and reader2.c and I am seeing a discrepency 
in the DTD validations. I have an XML file and corresponding DTD that are validated by xmllint and the 
parser2 test program but not validated by reader2. 
What is the difference between 
The calls to xmlCtxtReadFile like so 
doc = xmlCtxtReadFile(ctxt, filename, NULL, XML_PARSE_DTDVALID);
in parser2 and the call to xmlReaderForFile
reader = xmlReaderForFile(filename, NULL,
                 XML_PARSE_DTDATTR |  /* default DTD attributes */
XML_PARSE_NOENT |    /* substitute entities */
XML_PARSE_DTDVALID); /* validate with the DTD */
in reader2? Where is the error?

  within xmlreader.c code. The XML_PARSE_DTDVALID option should have 
forced a validation flag in the ctxt but didn't. The difference isn't
between those 2 calls but somewhere else in the initializations done by
xmllint when using --valid. This is fixed in CVS, in the meantime add
  xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
to force the setup of the flag in the reader.

   thanks for the report,


Daniel Veillard      | Red Hat Network
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]