I have an xml file I wish to transform using an xsl-document, but I can't seem to make it work on even the latest available Android versions.
I tried adding a <?xml-stylesheet/>
tag to the xml, but that didn't work in either the native browser or in Dolphin Browser.
E.g:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
<xmldata>Hello world</xmldata>
and
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/xmldata">
<em><xsl:value-of select="/xmldata"/></em>
</xsl:template>
</xsl:stylesheet>
is supposed to generate italic text, which it does in most desktop browsers (chrome has that annoying shared script root policy that ensures it only works when the files are not located on a local disc.) But it won't work in the mobile browser.
Is there a way to script the transform to happen client-side, or is the only option to do it server-side?
The default Android Browser starts supporting xsl transforms in the version that shows up in Android 4.0, Ice Cream Sandwich.
Other mobile browsers that have finally started supporting xsl are Opera Mobile and the Chrome Android Browser, currently in beta.
I just tested an XSLT example with Froyo browser and the result is a totally white page. However I installed Opera mobile browser for Android and it renders my example perfectly.
I cannot test in Opera mini because my test is served in a no internet accesible LAN.