I\'d like to be able to run an xml transformation using an xslt file in my AIR project. What\'s the best way to accomplish this?
In AIR 1.5, a version of Webkit with support for XSLT is included.
Use the class XSLTProcessor
from JavaScript just like you would in Firefox. (Note: There is one annoying bug. Stylesheets cannot contain non-breaking spaces, no matter whether literally or as a character reference. I am told that more recent versions of Webkit will fix this issue.)
Below is a complete example.
Create a file test.html
XSLT test
Output:
and a file test.xml
test
test
test.html
true
You can try it using the debugging runtime, for example:
adl test.xml
Klick the button, and it will say:
(source: lichteblau.com)