[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]