* xmlC14NPrintNamespaces: * @ns: the pointer to namespace * @ctx: the C14N context * * Prints the given namespace to the output buffer from C14N context. * * Returns 1 on success or 0 on fail. */
| 521 | * Returns 1 on success or 0 on fail. |
| 522 | */ |
| 523 | static int |
| 524 | xmlC14NPrintNamespaces(const xmlNs *ns, xmlC14NCtxPtr ctx) |
| 525 | { |
| 526 | |
| 527 | if ((ns == NULL) || (ctx == NULL)) { |
| 528 | xmlC14NErrParam(ctx); |
| 529 | return 0; |
| 530 | } |
| 531 | |
| 532 | if (ns->prefix != NULL) { |
| 533 | xmlOutputBufferWriteString(ctx->buf, " xmlns:"); |
| 534 | xmlOutputBufferWriteString(ctx->buf, (const char *) ns->prefix); |
| 535 | xmlOutputBufferWriteString(ctx->buf, "="); |
| 536 | } else { |
| 537 | xmlOutputBufferWriteString(ctx->buf, " xmlns="); |
| 538 | } |
| 539 | if(ns->href != NULL) { |
| 540 | xmlOutputBufferWriteQuotedString(ctx->buf, ns->href); |
| 541 | } else { |
| 542 | xmlOutputBufferWriteString(ctx->buf, "\"\""); |
| 543 | } |
| 544 | return (1); |
| 545 | } |
| 546 | |
| 547 | static int |
| 548 | xmlC14NPrintNamespacesWalker(const void *ns, void *ctx) { |
no test coverage detected