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

Function xmlTextWriterWriteAttribute

ThirdParty/libxml2/vtklibxml2/xmlwriter.c:2017–2039  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2015 * Returns the bytes written (may be 0 because of buffering) or -1 in case of error
2016 */
2017int
2018xmlTextWriterWriteAttribute(xmlTextWriterPtr writer, const xmlChar * name,
2019 const xmlChar * content)
2020{
2021 int count;
2022 int sum;
2023
2024 sum = 0;
2025 count = xmlTextWriterStartAttribute(writer, name);
2026 if (count < 0)
2027 return -1;
2028 sum += count;
2029 count = xmlTextWriterWriteString(writer, content);
2030 if (count < 0)
2031 return -1;
2032 sum += count;
2033 count = xmlTextWriterEndAttribute(writer);
2034 if (count < 0)
2035 return -1;
2036 sum += count;
2037
2038 return sum;
2039}
2040
2041/**
2042 * xmlTextWriterWriteFormatAttributeNS:

Callers 2

Calls 3

xmlTextWriterWriteStringFunction · 0.85

Tested by

no test coverage detected