File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / python / tests / xpathns.py
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 19:53:34 2014 UTC (10 years, 3 months ago) by misho
Branches: libxml2, MAIN
CVS tags: v2_9_1p0, v2_9_1, HEAD
libxml2 2.9.1

    1: #!/usr/bin/python -u
    2: #
    3: import libxml2
    4: 
    5: expect=' xmlns:a="urn:whatevar"'
    6: 
    7: # Memory debug specific
    8: libxml2.debugMemory(1)
    9: 
   10: d = libxml2.parseDoc("<a:a xmlns:a='urn:whatevar'/>")
   11: res=""
   12: for n in d.xpathEval("//namespace::*"):
   13:     res = res + n.serialize()
   14: d.freeDoc()
   15: 
   16: if res != expect:
   17:     print("test5 failed: unexpected output")
   18:     print(res)
   19: del res
   20: del d
   21: del n
   22: # Memory debug specific
   23: libxml2.cleanupParser()
   24: 
   25: if libxml2.debugMemory(1) == 0:
   26:     print("OK")
   27: else:
   28:     print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
   29:     libxml2.dumpMemory()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>