VirtualBox

source: vbox/trunk/src/libs/libxslt-1.1.22/python/tests/basic.py@ 7979

Last change on this file since 7979 was 7296, checked in by vboxsync, 17 years ago

Added libxslt-1.1.22 sources.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 682 bytes
Line 
1#!/usr/bin/python -u
2import sys
3import libxml2
4# Memory debug specific
5libxml2.debugMemory(1)
6import libxslt
7
8
9
10styledoc = libxml2.parseFile("test.xsl")
11style = libxslt.parseStylesheetDoc(styledoc)
12doc = libxml2.parseFile("test.xml")
13result = style.applyStylesheet(doc, None)
14style.saveResultToFilename("foo", result, 0)
15stringval = style.saveResultToString(result)
16if (len(stringval) != 68):
17 print "Error in saveResultToString"
18 sys.exit(255)
19style.freeStylesheet()
20doc.freeDoc()
21result.freeDoc()
22
23# Memory debug specific
24libxslt.cleanup()
25if libxml2.debugMemory(1) == 0:
26 print "OK"
27else:
28 print "Memory leak %d bytes" % (libxml2.debugMemory(1))
29 libxml2.dumpMemory()
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette