Re: [xml] Can xmllint format with in-place file saving?

2010-08-02 Thread Daniel Veillard
On Sun, Aug 01, 2010 at 10:37:57AM -0400, mruhrb...@aim.com 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

Re: [xml] Can xmllint format with in-place file saving?

2010-08-02 Thread Michael Ludwig
Daniel Veillard schrieb am 02.08.2010 um 11:40 (+0200): 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. Works. And I thought I knew all the options. -- Michael Ludwig

[xml] Can xmllint format with in-place file saving?

2010-08-01 Thread mruhrbach
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

Re: [xml] Can xmllint format with in-place file saving?

2010-08-01 Thread Liam R E Quin
On Sun, 2010-08-01 at 10:37 -0400, mruhrb...@aim.com 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

Re: [xml] Can xmllint format with in-place file saving?

2010-08-01 Thread Michael Ludwig
mruhrb...@aim.com schrieb am 01.08.2010 um 10:37 (-0400): Question: can this be done in one step? I imagine something like: xmllint --format --in-place file.xml, as is known form sed. No. But you can write a script to make it appear as one step. -- Michael Ludwig