MCPcopy Create free account
hub / github.com/Kitware/VTK / htmlNewDocNoDtD

Function htmlNewDocNoDtD

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:2343–2384  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

2341 * Returns a new document, do not initialize the DTD if not provided
2342 */
2343htmlDocPtr
2344htmlNewDocNoDtD(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:

Callers 3

xmlSAX2StartDocumentFunction · 0.85
htmlNewDocFunction · 0.85

Calls 1

xmlCreateIntSubsetFunction · 0.85

Tested by

no test coverage detected