diff options
-rw-r--r-- | include/dom/core/document.h | 3 | ||||
-rw-r--r-- | src/core/document.c | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/dom/core/document.h b/include/dom/core/document.h index 2c5c778..6d79d28 100644 --- a/include/dom/core/document.h +++ b/include/dom/core/document.h @@ -13,6 +13,7 @@ #include <dom/core/exceptions.h> struct dom_attr; +struct dom_characterdata; struct dom_configuration; struct dom_document; struct dom_document_type; @@ -35,6 +36,8 @@ dom_exception dom_document_create_document_fragment(struct dom_document *doc, struct dom_node **result); dom_exception dom_document_create_text_node(struct dom_document *doc, struct dom_string *data, struct dom_text **result); +dom_exception dom_document_create_comment(struct dom_document *doc, + struct dom_string *data, struct dom_characterdata **result); dom_exception dom_document_create_cdata_section(struct dom_document *doc, struct dom_string *data, struct dom_text **result); dom_exception dom_document_create_processing_instruction( diff --git a/src/core/document.c b/src/core/document.c index 383311e..b73f5e3 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -8,6 +8,7 @@ #include <dom/functypes.h> #include <dom/core/document.h> +#include "core/characterdata.h" #include "core/document.h" #include "core/namednodemap.h" #include "core/node.h" @@ -170,6 +171,28 @@ dom_exception dom_document_create_text_node(struct dom_document *doc, } /** + * Create a comment node + * + * \param doc The document owning the node + * \param data The data for the node + * \param result Pointer to location to receive result + * \return DOM_NO_ERR. + * + * The returned node will have its reference count increased. It is + * the responsibility of the caller to unref the node once it has + * finished with it. + */ +dom_exception dom_document_create_comment(struct dom_document *doc, + struct dom_string *data, struct dom_characterdata **result) +{ + UNUSED(doc); + UNUSED(data); + UNUSED(result); + + return DOM_NOT_SUPPORTED_ERR; +} + +/** * Create a CDATA section * * \param doc The document owning the section |