"""
Test the XML parser, etc...
"""
# $Id: test.py,v 1.1.1.1 2002/02/03 17:07:16 root Exp $
#
# $Log: test.py,v $
# Revision 1.1.1.1  2002/02/03 17:07:16  root
#
#
# Revision 1.2  2001/10/21 15:10:16  adrian
# no message
#
#
__version__ = '$Revision: 1.1.1.1 $'[11:-2]

import XML

str = """<?xml version="1.0"?>

<!DOCTYPE root SYSTEM "fred.dtd">

<?wibble fred=x=1 x=x?>

<!-- This is a comment -->

<root about="http://localhost">
<elem fred="1"></elem>
<elem fred="2"></elem>
<elem fred="3"></elem>
<elem fred="4"></elem>
</root>"""

x = XML.XMLParser.XMLParser()
x.feed(str)
x.close()

dom = x.DOM
root = dom.getNextChildByName('root')
del root.elem
root.elem['new_attr'] = "New Value"
root.addChild(XML.Node.Node('new_elem'))

print dom
