[xml] Post validation



Hi All,

Before I dive in and attempt to (re-)invent the wheel, I'll seek advice on how to go about a task that is currently causing me difficulties.

In my library I parse an XML document using the xmlTextReader interface. In some circumstances I then want to validate the document, using a call to xmlValidateDocument. If the document has specified its DTD using an external ID (actually a SYSTEM identifier) that is a relative URL, validation fails because the relative URL cannot be resolved. This is because xmlValidateDocument calls xmlParseDTD(ExternalID, SystemID) but it does not pass a base URI for resolving the relative URL.

Starting with the xmlDocPtr for the original document, is there a simple way to get the DTD parsed when it is given as a relative URL? Or do I need to explicitly parse the external DTD subset before invoking xmlValidateDocument?

Any advice greatly appreciated...
Steve Ball

---

Steve Ball            |   XSLT Standard Library   | Training & Seminars
Zveno Pty Ltd         |     Web Tcl Complete      |   XML XSL Schemas
http://www.zveno.com/ |      TclXML TclDOM        | Tcl, Web Development
Steve Ball zveno com  +---------------------------+---------------------
Ph. +61 2 6242 4099   |   Mobile (0413) 594 462   | Fax +61 2 6242 4099




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