* htmlNewDocNoDtD: * @URI: URI for the dtd, or NULL * @ExternalID: the external ID of the DTD, or NULL * * Creates a new HTML document without a DTD node if @URI and @ExternalID * are NULL * * Returns a new document, do not initialize the DTD if not provided */
| 2341 | * Returns a new document, do not initialize the DTD if not provided |
| 2342 | */ |
| 2343 | htmlDocPtr |
| 2344 | htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) { |
| 2345 | xmlDocPtr cur; |
| 2346 | |
| 2347 | /* |
| 2348 | * Allocate a new document and fill the fields. |
| 2349 | */ |
| 2350 | cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc)); |
| 2351 | if (cur == NULL) |
| 2352 | return(NULL); |
| 2353 | memset(cur, 0, sizeof(xmlDoc)); |
| 2354 | |
| 2355 | cur->type = XML_HTML_DOCUMENT_NODE; |
| 2356 | cur->version = NULL; |
| 2357 | cur->intSubset = NULL; |
| 2358 | cur->doc = cur; |
| 2359 | cur->name = NULL; |
| 2360 | cur->children = NULL; |
| 2361 | cur->extSubset = NULL; |
| 2362 | cur->oldNs = NULL; |
| 2363 | cur->encoding = NULL; |
| 2364 | cur->standalone = 1; |
| 2365 | cur->compression = 0; |
| 2366 | cur->ids = NULL; |
| 2367 | cur->refs = NULL; |
| 2368 | cur->_private = NULL; |
| 2369 | cur->charset = XML_CHAR_ENCODING_UTF8; |
| 2370 | cur->properties = XML_DOC_HTML | XML_DOC_USERBUILT; |
| 2371 | if ((ExternalID != NULL) || |
| 2372 | (URI != NULL)) { |
| 2373 | xmlDtdPtr intSubset; |
| 2374 | |
| 2375 | intSubset = xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI); |
| 2376 | if (intSubset == NULL) { |
| 2377 | xmlFree(cur); |
| 2378 | return(NULL); |
| 2379 | } |
| 2380 | } |
| 2381 | if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue)) |
| 2382 | xmlRegisterNodeDefaultValue((xmlNodePtr)cur); |
| 2383 | return(cur); |
| 2384 | } |
| 2385 | |
| 2386 | /** |
| 2387 | * htmlNewDoc: |
no test coverage detected