diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-26 13:17:08 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-26 13:17:08 +0000 |
commit | 7233f9f6b42282c407d584e92578bae4b1eb7cb1 (patch) | |
tree | db63c1840db873ab4b0170a3fb030de80d8aa2e5 /bindings | |
parent | a3ae38c428cfefb0b9c52f551116becebc85ba0b (diff) | |
download | libdom-7233f9f6b42282c407d584e92578bae4b1eb7cb1.tar.gz libdom-7233f9f6b42282c407d584e92578bae4b1eb7cb1.tar.bz2 |
Add ability to set a document's doctype after the document has been created
svn path=/trunk/dom/; revision=3462
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/xml/xmlparser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bindings/xml/xmlparser.c b/bindings/xml/xmlparser.c index 5c63b29..9e907d6 100644 --- a/bindings/xml/xmlparser.c +++ b/bindings/xml/xmlparser.c @@ -13,6 +13,7 @@ #include <libxml/SAX2.h> #include <libxml/xmlerror.h> +#include <dom/bootstrap/implpriv.h> #include <dom/dom.h> #include "xmlerror.h" @@ -1089,9 +1090,13 @@ void xml_parser_add_document_type(xml_parser *parser, dom_string_unref(public_id); dom_string_unref(qname); - /** \todo Add doctype to document (requires some libdom-internal API - * -- doctypes are immutable in the DOM) */ - UNUSED(parent); + /* Add doctype to document */ + err = dom_document_set_doctype((struct dom_document *) parent, + doctype); + if (err != DOM_NO_ERR) { + dom_node_unref((struct dom_node *) doctype); + return; + } /* Link nodes together */ err = xml_parser_link_nodes(parser, (struct dom_node *) doctype, |