XSLT in Author
Posted: Thu Apr 06, 2023 2:42 pm
Hi,
I have an XML file encoded in ISO8859-1 using a lot of entities that are defined in an DTD and have some trouble when invoking an XSLT-Transformation in a framework via the XSLTOperation class.
My XSLT reads another XML-file (encoded in UTF-8) via the XPath document()-function and compares strings from this source with strings from the XML that is transformed. When I define a Transformation scenario, everything works fine. If I compare for instance the string "Ümlaut" from the ISO-encoded XML source with the string "Ümlaut" from the UTF-8 encoded reference XML, matches() returns 'true'. The first string is internally parsed as a unicode-string, which is the behavior I would expect from Saxon. This also works, when I define a function in my framework starting the transformation scenario via the "ExecuteTransformationScenariosOperation" class
But, when I invoke the script via Author mode's "XSLTOperation", the first sting is internally parsed as "Ümlaut"(!) and when using the match()-function to compare it to "Ümlaut", the result is 'false'.
It doesn't matter if I copy the script directly in the XSLTOperation's 'script' attribute, or if I insert just a link to the script that is stored in my framework directory.
It seems this behavior occured after moving to oxygen 25.1, but I can't test it.
I attached a very simple test file and a test scenario with an XSLT and predefined functions for author mode, reproducing the problem.
Any ideas on this?
Thanks,
Bilbo
I have an XML file encoded in ISO8859-1 using a lot of entities that are defined in an DTD and have some trouble when invoking an XSLT-Transformation in a framework via the XSLTOperation class.
My XSLT reads another XML-file (encoded in UTF-8) via the XPath document()-function and compares strings from this source with strings from the XML that is transformed. When I define a Transformation scenario, everything works fine. If I compare for instance the string "Ümlaut" from the ISO-encoded XML source with the string "Ümlaut" from the UTF-8 encoded reference XML, matches() returns 'true'. The first string is internally parsed as a unicode-string, which is the behavior I would expect from Saxon. This also works, when I define a function in my framework starting the transformation scenario via the "ExecuteTransformationScenariosOperation" class
But, when I invoke the script via Author mode's "XSLTOperation", the first sting is internally parsed as "Ümlaut"(!) and when using the match()-function to compare it to "Ümlaut", the result is 'false'.
It doesn't matter if I copy the script directly in the XSLTOperation's 'script' attribute, or if I insert just a link to the script that is stored in my framework directory.
It seems this behavior occured after moving to oxygen 25.1, but I can't test it.
I attached a very simple test file and a test scenario with an XSLT and predefined functions for author mode, reproducing the problem.
Any ideas on this?
Thanks,
Bilbo