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

Thanks for the reply.
I have set the option like this:
    xmlCtxtUseOptions(m_context, XML_PARSE_DTDLOAD);
But the parser does not seem to complain about junk tags & wrong sequence of tags at all and says that the document is valid.

----- Original Message ----
From: Daniel Veillard <veillard redhat com>
To: mayur k <mayur_ruk yahoo com>
Cc: xml gnome org
Sent: Thursday, October 11, 2007 8:16:06 PM
Subject: 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
>    default.

  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 "dt-xlg"

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

Shape Yahoo! in your own image. Join our Network Research Panel today!

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