* xmlTextWriterWriteAttributeNS: * @writer: the xmlTextWriterPtr * @prefix: namespace prefix * @name: attribute local name * @namespaceURI: namespace URI * @content: attribute content * * Write an xml attribute. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */
| 2120 | * Returns the bytes written (may be 0 because of buffering) or -1 in case of error |
| 2121 | */ |
| 2122 | int |
| 2123 | xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer, |
| 2124 | const xmlChar * prefix, const xmlChar * name, |
| 2125 | const xmlChar * namespaceURI, |
| 2126 | const xmlChar * content) |
| 2127 | { |
| 2128 | int count; |
| 2129 | int sum; |
| 2130 | |
| 2131 | if ((writer == NULL) || (name == NULL) || (*name == '\0')) |
| 2132 | return -1; |
| 2133 | |
| 2134 | sum = 0; |
| 2135 | count = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI); |
| 2136 | if (count < 0) |
| 2137 | return -1; |
| 2138 | sum += count; |
| 2139 | count = xmlTextWriterWriteString(writer, content); |
| 2140 | if (count < 0) |
| 2141 | return -1; |
| 2142 | sum += count; |
| 2143 | count = xmlTextWriterEndAttribute(writer); |
| 2144 | if (count < 0) |
| 2145 | return -1; |
| 2146 | sum += count; |
| 2147 | |
| 2148 | return sum; |
| 2149 | } |
| 2150 | |
| 2151 | /** |
| 2152 | * xmlTextWriterWriteFormatElement: |
no test coverage detected