* 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 */
| 2015 | * Returns the bytes written (may be 0 because of buffering) or -1 in case of error |
| 2016 | */ |
| 2017 | int |
| 2018 | xmlTextWriterWriteAttribute(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: |
no test coverage detected