From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Feb 23 2000 - 05:31:11 EST
On Wed, Feb 23, 2000 at 10:56:15AM +0100, Nadine Peyrouze wrote:
> 2 questions about the use of external dtd
>
> 1) is there any function for inserting or modidying the <!DOCTYPE
> ..... > in an
> xml document (to specify SYSTEM "path" ) ?
> some functions (like xmlNewDtd) seems to allow it but in the in
> memory
> document only : i.e, the corresponding DOCTYPE line is not inserted
> in the
> saved xml file.
function to modify the path, no, just avoid doing the valididy checking
It is possible to do a-posteriori valididy checking using either the
existing DTd info
xmlValidateDocument()
or an extra DTD:
xmlValidateDtd()
The debug shell front end show uses of this :
xmlShellValidate()
> 2) when a document is already parsed in memory, is there any way to make
> it use a
> new Dtd (to get default values through xmlGetProp) without reloading
> the
> document ?
Hum, no. But it should not be that hard. Parse the external Dtd
using xmlParseDTD() and link it as the document external subset
doc->extSubset.
Note however that you may get different result with this technique
than during normal parsing:
Some DTDs are done in an extensible way, i.e. some of the productions
can be extended with parameter entities defined in the internal subset.
If you use xmlParseDTD() those won't be looked at, resulting in a
different class of valid documents
this is subtle but should not be neglected. This also mean that I need
to etend the API to allow parsing of a DTD in teh context of an existing
document.
Daniel
-- Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | Today's Bookmarks : Tel : +33 476 615 257 | 655, avenue de l'Europe | Linux XML libxml WWW Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind http://www.w3.org/People/all#veillard%40w3.org | RPM badminton Kaffe ---- Message from the list xml@xmlsoft.org Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@xmlsoft.org
This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:05 EDT