On Sun, Aug 01, 2010 at 10:37:57AM -0400, [email protected] wrote: > Hello list, > > I run xmllint to format my XML file: xmllint --format file.xml > > The output goes to stdout, so I capture it in a file: xmllint > --format file.xml > formatted.xml > > Now I replace the old with the new: mv formatted.xml file.xml > > Question: can this be done in one step? I imagine something like: > xmllint --format --in-place file.xml, as is known form sed.
xmllint -o res.xml tst.xml I think xmllint -o tst.xml --format tst.xml should be safe as the parser will fully load the input into a tree before opening the output to serialize it. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ [email protected] | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ [email protected] http://mail.gnome.org/mailman/listinfo/xml
