Top-rated recipes tagged "xpath"http://code.activestate.com/recipes/tags/xpath/top/2011-01-19T16:05:24-08:00ActiveState Code RecipesFlatten XML to XPath syntax lines (Python)
2011-01-19T16:05:24-08:00Raphaël Jolivethttp://code.activestate.com/recipes/users/4135673/http://code.activestate.com/recipes/577547-flatten-xml-to-xpath-syntax-lines/
<p style="color: grey">
Python
recipe 577547
by <a href="/recipes/users/4135673/">Raphaël Jolivet</a>
(<a href="/recipes/tags/flatten/">flatten</a>, <a href="/recipes/tags/grep/">grep</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/xml/">xml</a>, <a href="/recipes/tags/xpath/">xpath</a>).
</p>
<p>This script acts like <a href="http://www.ofb.net/~egnor/xml2/">xml2</a>.
It transforms a XML file into a flat text output, with <em>XPath</em>-like syntax, one line per XML node or attribute.
This format is more suitable for working with standard unix CLI utils (sed, grep, ... etc).</p>