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
|
---|
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()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.