Re: [xml] XML DTD validation for push parsers?

On Thu, Oct 11, 2007 at 05:42:31AM -0700, mayur k wrote:

   Hi All,
   I would like to know if DTD validation for push parsers is disabled by

  validation is never enabled by default you have to request it.

   I have tried passing a complete xml buffer and then setting options to
   load dtd and validate the document.
   But  the  parser does not seem to validate the document and is parsing
   even a document which has non-conforming tags!!

  Seems to work here

paphio:~/XML -> xmllint --noout --push --valid test/valid/xlink.xml 
test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined
        <p><termdef id="dt-arc" term="Arc">An <term>arc</term> is contained within an e
test/valid/xlink.xml:530: element termref: validity error : IDREF attribute def references an unknown ID 

paphio:~/XML ->

   Is there some other way to validate the xml in push mode?

  just do what xmllint.c with those flags do, 

                    ctxt = xmlCreatePushParserCtxt(NULL, NULL,
                                chars, res, filename);
                    xmlCtxtUseOptions(ctxt, options);

with appropriate options.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]