[xml] valid document confirmation

Date view Thread view Subject view Author view

From: Adam Clarke (clarke@pacbell.net)
Date: Tue Oct 10 2000 - 07:19:38 EDT


Assuming one is parsing and validating a document, eg

...
extern int xmlDoValidityCheckingDefaultValue = 1;
...
    res = fread(chars, 1, 4, stdin);
    if (res > 0) {
        ctxt = xmlCreatePushParserCtxt(NULL, NULL, chars, res, "stdin");
        while ((res = fread(chars, 1, size, stdin)) > 0) {
            xmlParseChunk(ctxt, chars, res, 0);
        }
        xmlParseChunk(ctxt, chars, 0, 1);
        doc = ctxt->myDoc;
        xmlFreeParserCtxt(ctxt);
    }
...

how do I test at this point if my document is valid?
I would like to exit our of my process if any validation
errors or warnings have occurred....

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Oct 10 2000 - 17:44:39 EDT