Author xtreak
Recipients eli.bendersky, rhettinger, scoder, serhiy.storchaka, xtreak
Date 2019-08-24.14:55:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1566658533.41.0.722111821042.issue37940@roundup.psfhosted.org>
In-reply-to
Content
Now that XML has pretty print option with issue14465 would it be handy to add a command line tool pretty printer similar to json.tool? This can be written as one-liner similar to json pretty printing but I think it's a good option and having a command line tool also helps in piping the output to other commands like filtering particular tags. I tried searching mailing list and couldn't find any discussions along these lines. There were some concerns around using external tools and  in https://bugs.python.org/issue14465#msg324098 . I thought to open this to gather feedback.

Branch : https://github.com/tirkarthi/cpython/tree/bpo14465-xml-tool


python -m xml.tool /tmp/person.xml
<root>
  <person name="Kate">
    <breakfast>Idly</breakfast>
  </person>
  <person name="John">
    <breakfast>Dosa</breakfast>
  </person>
</root>

# Get all breakfast tags

python -m xml.tool /tmp/person.xml | grep breakfast
    <breakfast>Idly</breakfast>
    <breakfast>Dosa</breakfast>
History
Date User Action Args
2019-08-24 14:55:33xtreaksetrecipients: + xtreak, rhettinger, scoder, eli.bendersky, serhiy.storchaka
2019-08-24 14:55:33xtreaksetmessageid: <1566658533.41.0.722111821042.issue37940@roundup.psfhosted.org>
2019-08-24 14:55:33xtreaklinkissue37940 messages
2019-08-24 14:55:33xtreakcreate