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.
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/Daniel Veillard | virtualization library
http://libvirt.org/veillard redhat com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/http://veillard.com/ | Rpmfind RPM
search engine
http://rpmfind.net/