libxml2dom

macrotest.py

43:014f4a169314
2005-01-14 paulb [project @ 2005-01-14 15:39:02 by paulb] Added the beginnings of a macro library variant of libxml2dom.
     1 #!/usr/bin/env python     2      3 "A test of macros."     4      5 from libxml2dom.macrolib import *     6 import libxml2     7 import xml.dom     8 import sys     9     10 x2_d = libxml2.parseFile(sys.argv[1])    11 x2_root = None    12 for x2_n in x2_d.childNodes:    13     if x2_n.nodeType == xml.dom.Node.ELEMENT_NODE:    14         x2_root = x2_n    15         break    16     17 print x2_root.localName, x2_root.namespaceURI, x2_root.getAttributeNS(None, "xmlns")    18     19 # vim: tabstop=4 expandtab shiftwidth=4