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

Function xmlNewCDataBlock

ThirdParty/libxml2/vtklibxml2/tree.c:2650–2675  ·  view source on GitHub ↗

* xmlNewCDataBlock: * @doc: the target document (optional) * @content: raw text content (optional) * @len: size of text content * * Create a CDATA section node. * * Returns a pointer to the new node object or NULL if a memory * allocation failed. */

Source from the content-addressed store, hash-verified

2648 * allocation failed.
2649 */
2650xmlNodePtr
2651xmlNewCDataBlock(xmlDocPtr doc, const xmlChar *content, int len) {
2652 xmlNodePtr cur;
2653
2654 /*
2655 * Allocate a new node and fill the fields.
2656 */
2657 cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
2658 if (cur == NULL)
2659 return(NULL);
2660 memset(cur, 0, sizeof(xmlNode));
2661 cur->type = XML_CDATA_SECTION_NODE;
2662 cur->doc = doc;
2663
2664 if (content != NULL) {
2665 cur->content = xmlStrndup(content, len);
2666 if (cur->content == NULL) {
2667 xmlFree(cur);
2668 return(NULL);
2669 }
2670 }
2671
2672 if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
2673 xmlRegisterNodeDefaultValue(cur);
2674 return(cur);
2675}
2676
2677/**
2678 * xmlNewDocComment:

Callers 1

xmlSAX2TextFunction · 0.85

Calls 1

xmlStrndupFunction · 0.85

Tested by

no test coverage detected