RE: [xml] external dtd insertion



Hello Deryk,

If i got it right, the reference to an external subset is
equivalent to the root node of an internal subset
(so to say).
Therefore, try to use

  xmlCreateIntSubset(doc, "foo", NULL, "./foo.dtd");

That works for me, i hope it'll also for you.


Ciao, Markus



-----Original Message-----
From: Deryk Robosson [mailto:deryk www iitowns com]
Sent: Saturday, April 06, 2002 11:37 AM
To: xml gnome org
Subject: [xml] external dtd insertion


I am unable to figure out exactly what I need in regards to adding an
existing doctype declaration to a document created on the fly.

What I've tried thus far is:

xmlDocPtr doc;
xmlDtdPtr dtd;

doc = xmlNewDoc("1.0");
dtd = xmlNewDtd(doc, "foo", "SYSTEM", "./foo.dtd");
doc->children = xmlNewDocNode(doc, NULL, "test", NULL);
xmlDocDump(stderr, doc);

The above does not insert the <!DOCTYPE> line into the doc 
dump output.
The following does not as well:

xmlDocPtr doc;

doc = xmlNewDoc("1.0");
doc->exSubset = xmlNewDtd(doc, "foo", "SYSTEM", "./foo.dtd");
doc->children = xmlNewDocNode(doc, NULL, "test", NULL);
xmlDocDump(stderr, doc);


Any advice or pointers to a page on the site I perhaps misses is
appreciated.







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