2 * Copyright (C) 2021 EfficiOS Inc.
4 * SPDX-License-Identifier: GPL-2.0-only
9 * Prettyfi a xml input from stdin to stddout.
10 * This allows a more human friendly format for xml testing when problems occur.
15 #include <libxml/parser.h>
26 xml_parser_ctx_uptr parserCtx
{ xmlNewParserCtxt() };
28 /* Parse the XML document from stdin. */
30 parserCtx
.get(), STDIN_FILENO
, nullptr, nullptr, XML_PARSE_NOBLANKS
);
32 fprintf(stderr
, "ERR parsing: xml input invalid");
36 xmlDocFormatDump(stdout
, doc
, 1);
41 /* Shutdown libxml. */