[XML-SIG] XML/python approach to "smooshing docs together"?

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun, 12 Nov 2000 00:52:50 +0100

> All ideas gratefully received...

It is certainly easy to combine the three XML files in a single parse
with a good SAX ContentHandler. Use a PyXML
xml.sax.saxutils.XMLGenerator as a base class, but keep an option in
it to ignore a sequence of starting and closing tags.

When parsing the first document, output


When parsing the second one, output


And when parsing the third one, output

      <pgm name="DIFF" path="/usr/bin/diff" />
      <pgm name="MAKE" path="/usr/ccs/bin/make" />

If you need more complex merge operations, you can try merging DOM
trees, or use XSLT.