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

Function xmlTextWriterWriteElementNS

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:2327–2355  ·  view source on GitHub ↗

* xmlTextWriterWriteElementNS: * @writer: the xmlTextWriterPtr * @prefix: namespace prefix * @name: element local name * @namespaceURI: namespace URI * @content: element content * * Write an xml element with namespace support. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */

Source from the content-addressed store, hash-verified

2325 * Returns the bytes written (may be 0 because of buffering) or -1 in case of error
2326 */
2327int
2328xmlTextWriterWriteElementNS(xmlTextWriterPtr writer,
2329 const xmlChar * prefix, const xmlChar * name,
2330 const xmlChar * namespaceURI,
2331 const xmlChar * content)
2332{
2333 int count;
2334 int sum;
2335
2336 if ((writer == NULL) || (name == NULL) || (*name == '\0'))
2337 return -1;
2338
2339 sum = 0;
2340 count =
2341 xmlTextWriterStartElementNS(writer, prefix, name, namespaceURI);
2342 if (count < 0)
2343 return -1;
2344 sum += count;
2345 count = xmlTextWriterWriteString(writer, content);
2346 if (count == -1)
2347 return -1;
2348 sum += count;
2349 count = xmlTextWriterEndElement(writer);
2350 if (count == -1)
2351 return -1;
2352 sum += count;
2353
2354 return sum;
2355}
2356
2357/**
2358 * xmlTextWriterStartPI:

Callers 1

Calls 3

xmlTextWriterWriteStringFunction · 0.85
xmlTextWriterEndElementFunction · 0.85

Tested by

no test coverage detected