* 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 */
| 2325 | * Returns the bytes written (may be 0 because of buffering) or -1 in case of error |
| 2326 | */ |
| 2327 | int |
| 2328 | xmlTextWriterWriteElementNS(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: |
no test coverage detected