views:

180

answers:

1

I've used xmlstartlet to process XML files before. You can give it a simple comannd line and it will generate (internally) an XSLT template and apply that to an XML file.

However now I have a large XML file, so I really need to use SAX for this, not XSLT. Rather than write a simple programme to do this, I'm wondering if there is a more simplier way, to have a really simple SAX parser from the command line. You could give it a few options and it would whiz along your XML file and print out some structured data from it.

A: 

Download Python and run it in interactive command line mode.

DOCS http://docs.python.org/library/xml.sax.html

EXAMPLE: Showing progress while parsing a huge file in Python

danglund