From d208ad37e9dea0e3854e70eef40e33716c54aff0 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 26 Jul 2007 13:17:08 +0000 Subject: Add ability to set a document's doctype after the document has been created svn path=/trunk/dom/; revision=3462 --- bindings/xml/xmlparser.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bindings/xml') 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 #include +#include #include #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, -- cgit v1.2.3