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

Function xmlTextWriterWriteElement

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:2220–2244  ·  view source on GitHub ↗

* xmlTextWriterWriteElement: * @writer: the xmlTextWriterPtr * @name: element name * @content: element content * * Write an xml element. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */

Source from the content-addressed store, hash-verified

2218 * Returns the bytes written (may be 0 because of buffering) or -1 in case of error
2219 */
2220int
2221xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name,
2222 const xmlChar * content)
2223{
2224 int count;
2225 int sum;
2226
2227 sum = 0;
2228 count = xmlTextWriterStartElement(writer, name);
2229 if (count == -1)
2230 return -1;
2231 sum += count;
2232 if (content != NULL) {
2233 count = xmlTextWriterWriteString(writer, content);
2234 if (count == -1)
2235 return -1;
2236 sum += count;
2237 }
2238 count = xmlTextWriterEndElement(writer);
2239 if (count == -1)
2240 return -1;
2241 sum += count;
2242
2243 return sum;
2244}
2245
2246/**
2247 * xmlTextWriterWriteFormatElementNS:

Callers 1

Calls 3

xmlTextWriterWriteStringFunction · 0.85
xmlTextWriterEndElementFunction · 0.85

Tested by

no test coverage detected