1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-29 15:41:13 +03:00

tests: Fix out-of-tree Python tests

This commit is contained in:
Nick Wellnhofer
2022-09-07 21:05:21 +02:00
parent 367b929460
commit cc64f2a78b

View File

@ -1,15 +1,16 @@
#!/usr/bin/env python
import os
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
import libxslt
basedir = os.path.dirname(os.path.realpath(__file__))
styledoc = libxml2.parseFile("test.xsl")
styledoc = libxml2.parseFile("%s/test.xsl" % basedir)
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseFile("test.xml")
doc = libxml2.parseFile("%s/test.xml" % basedir)
result = style.applyStylesheet(doc, None)
style.saveResultToFilename("foo", result, 0)
stringval = style.saveResultToString(result)