In my application I am using the 4Suite.org XSLT library to perform transformations of source XML. The syntax is like this:
from Ft.Xml.Xslt import Transform
transformed_xml = Transform(raw_xml, stylesheet)
where raw_xml
and stylesheet
have been defined elsewhere in my application. raw_xml
will be the xml resulting from reading a filehandle opened with the codecs module so the raw_xml
will be unicode.
The problem is that the Transform() function requires the value of the source xml (raw_xml
in my example) to be ascii. It says so in the pydoc and my own program fails with an error along those lines if I try to transform unicode.
Is there a different approach or is there another python library which can perform an XSLT transformation against a unicode source? Or, am I misunderstanding something about XSLT transformations?