OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python -u |
| 2 import sys |
| 3 import libxml2 |
| 4 # Memory debug specific |
| 5 libxml2.debugMemory(1) |
| 6 import libxslt |
| 7 |
| 8 |
| 9 |
| 10 styledoc = libxml2.parseFile("test.xsl") |
| 11 style = libxslt.parseStylesheetDoc(styledoc) |
| 12 doc = libxml2.parseFile("test.xml") |
| 13 result = style.applyStylesheet(doc, None) |
| 14 style.saveResultToFilename("foo", result, 0) |
| 15 stringval = style.saveResultToString(result) |
| 16 if (len(stringval) != 68): |
| 17 print "Error in saveResultToString" |
| 18 sys.exit(255) |
| 19 style.freeStylesheet() |
| 20 doc.freeDoc() |
| 21 result.freeDoc() |
| 22 |
| 23 # Memory debug specific |
| 24 libxslt.cleanup() |
| 25 if libxml2.debugMemory(1) == 0: |
| 26 print "OK" |
| 27 else: |
| 28 print "Memory leak %d bytes" % (libxml2.debugMemory(1)) |
| 29 libxml2.dumpMemory() |
OLD | NEW |