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

Function xmlNodeSetContentInternal

ThirdParty/libxml2/vtklibxml2/tree.c:5720–5757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5718}
5719
5720static int
5721xmlNodeSetContentInternal(xmlNodePtr cur, const xmlChar *content, int len) {
5722 if (cur == NULL) {
5723 return(1);
5724 }
5725 switch (cur->type) {
5726 case XML_DOCUMENT_FRAG_NODE:
5727 case XML_ELEMENT_NODE:
5728 case XML_ATTRIBUTE_NODE:
5729 if (xmlNodeParseContent(cur, content, len) < 0)
5730 return(-1);
5731 break;
5732
5733 case XML_TEXT_NODE:
5734 case XML_CDATA_SECTION_NODE:
5735 case XML_PI_NODE:
5736 case XML_COMMENT_NODE: {
5737 xmlChar *copy = NULL;
5738
5739 if (content != NULL) {
5740 if (len < 0)
5741 copy = xmlStrdup(content);
5742 else
5743 copy = xmlStrndup(content, len);
5744 if (copy == NULL)
5745 return(-1);
5746 }
5747
5748 xmlTextSetContent(cur, copy);
5749 break;
5750 }
5751
5752 default:
5753 break;
5754 }
5755
5756 return(0);
5757}
5758
5759/**
5760 * xmlNodeSetContent:

Callers 2

xmlNodeSetContentFunction · 0.85
xmlNodeSetContentLenFunction · 0.85

Calls 4

xmlNodeParseContentFunction · 0.85
xmlStrdupFunction · 0.85
xmlStrndupFunction · 0.85
xmlTextSetContentFunction · 0.85

Tested by

no test coverage detected