* xmlTextWriterWritePI: * @writer: the xmlTextWriterPtr * @target: PI target * @content: PI content * * Write an xml PI. * * Returns the bytes written (may be 0 because of buffering) or -1 in case of error */
| 2571 | * Returns the bytes written (may be 0 because of buffering) or -1 in case of error |
| 2572 | */ |
| 2573 | int |
| 2574 | xmlTextWriterWritePI(xmlTextWriterPtr writer, const xmlChar * target, |
| 2575 | const xmlChar * content) |
| 2576 | { |
| 2577 | int count; |
| 2578 | int sum; |
| 2579 | |
| 2580 | sum = 0; |
| 2581 | count = xmlTextWriterStartPI(writer, target); |
| 2582 | if (count == -1) |
| 2583 | return -1; |
| 2584 | sum += count; |
| 2585 | if (content != 0) { |
| 2586 | count = xmlTextWriterWriteString(writer, content); |
| 2587 | if (count == -1) |
| 2588 | return -1; |
| 2589 | sum += count; |
| 2590 | } |
| 2591 | count = xmlTextWriterEndPI(writer); |
| 2592 | if (count == -1) |
| 2593 | return -1; |
| 2594 | sum += count; |
| 2595 | |
| 2596 | return sum; |
| 2597 | } |
| 2598 | |
| 2599 | /** |
| 2600 | * xmlTextWriterStartCDATA: |
no test coverage detected