Re: [xml] Unable to validate a dtd using libxml

--- Daniel Veillard <veillard redhat com> wrote:
On Tue, Jun 11, 2002 at 08:32:10AM +0530, Vidhya
Anand wrote:

I am unable to validate any dtd using libxml. Used
description provided
by you in a mailing list to validate dtd.


The dtd file(winfodtd.txt) and related error
messages(error message.txt)

are attached. Can you please point out the problem
with my input? Any
help will be appreciated.

  you're trying to parse the standalone DTD with the
XML content parser
no surprize it doesn't work !
  Use xmlParseDTD().


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

Thanks for your prompt response.

I am using xmlParseDTD as described in your mail. My
code reads as follows and the behaviour is as
described in previous mail. I am unable to figure my

if ((dtd = xmlParseDTD(NULL, (const xmlChar *)
             dtdvalid.c_str())) == NULL)
    printf ("Could not parse DTD\n") ;
    xmlValidCtxt cvp;
    cvp.userData = (void *) stderr;
    cvp.error    = (xmlValidityErrorFunc) fprintf;
    cvp.warning  = (xmlValidityWarningFunc) fprintf;
    if (!xmlValidateDtd(&cvp, _doc, dtd))
        printf ("XML contents does not validate
                  against DTD\n");

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

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