1.1 --- a/test.py Sun Oct 05 23:49:54 2003 +0000
1.2 +++ b/test.py Mon Oct 06 18:59:57 2003 +0000
1.3 @@ -3,22 +3,19 @@
1.4 import libxml2dom
1.5 import libxml2
1.6 from xml.dom.ext import PrettyPrint
1.7 +import sys
1.8
1.9 -#doc = libxml2.parseFile("XMLTools2/examples/zoo/zoo_schema.xml")
1.10 -doc = libxml2.parseDoc("""<?xml version="1.0" encoding="iso-8859-15"?>
1.11 -<schema xmlns="http://www.boddie.org.uk/ns/xmltools/model"
1.12 - xmlns:database="http://www.boddie.org.uk/ns/xmltools/database">
1.13 +doc = libxml2.parseFile(sys.argv[1])
1.14
1.15 - <def-element name="cage" database:table="CAGE"/>
1.16 -</schema>
1.17 -""")
1.18 +#doc = libxml2.parseDoc("""<?xml version="1.0" encoding="iso-8859-15"?>
1.19 +#<schema xmlns="http://www.boddie.org.uk/ns/xmltools/model"
1.20 +# xmlns:database="http://www.boddie.org.uk/ns/xmltools/database">
1.21 +#
1.22 +# <def-element name="cage" database:table="CAGE"/>
1.23 +#</schema>
1.24 +#""")
1.25 +
1.26 d = libxml2dom.Node(doc)
1.27 +PrettyPrint(d)
1.28
1.29 -# This works:
1.30 -print d.childNodes[0].childNodes[1]._node.nsProp("table", 'http://www.boddie.org.uk/ns/xmltools/database')
1.31 -print doc.children.children.next.nsProp("table", 'http://www.boddie.org.uk/ns/xmltools/database')
1.32 -# This works only with an appropriate patch to libxml2 2.5.7:
1.33 -print d.childNodes[0].childNodes[1].attributes.values()[1]._node.ns()
1.34 -# Equivalent to:
1.35 -print d.childNodes[0].childNodes[1]._node.properties.next.ns()
1.36 -print doc.children.children.next.properties.next.ns()
1.37 +# vim: tabstop=4 expandtab shiftwidth=4