5 # Memory debug specific
9 # Testing XML document serialization
11 doc = libxml2.parseDoc(
12 """<?xml version="1.0" encoding="iso-8859-1"?>
14 <!ELEMENT test (#PCDATA) >
15 <!ATTLIST test xmlns:abc CDATA #FIXED "http://abc.org" >
16 <!ATTLIST test abc:attr CDATA #FIXED "def" >
20 elem = doc.getRootElement()
21 attr = elem.hasNsProp('attr', 'http://abc.org')
22 if attr == None or attr.serialize()[:-1] != """<!ATTLIST test abc:attr CDATA #FIXED "def">""":
23 print "Failed to find defaulted attribute abc:attr"
28 # Memory debug specific
29 libxml2.cleanupParser()
30 if libxml2.debugMemory(1) == 0:
33 print "Memory leak %d bytes" % (libxml2.debugMemory(1))