The argument name could also be --no-xmldecl but in XSLT (a very verbose language) it is named omit-xml-declaration. Use case is creation of XML fragments, for instance of you loop over multiple input files with a shell script and combine the result in one XML document.
An possibly better alternative worth to consider is allowing to omit the XML root element for emitting XML fragments. This also requires possibility to omit XML declaration in XML::Builder:
echo '{"x":1}' | ./bin/oq -o xml --xml-root "" .
<x>1</x>
I almost created a pull request...
but the crystal core library (
XML::Builder
) does not support omitting the XML declaration. Expected:The argument name could also be
--no-xmldecl
but in XSLT (a very verbose language) it is namedomit-xml-declaration
. Use case is creation of XML fragments, for instance of you loop over multiple input files with a shell script and combine the result in one XML document.An possibly better alternative worth to consider is allowing to omit the XML root element for emitting XML fragments. This also requires possibility to omit XML declaration in
XML::Builder
: