Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the Android Browser capable of performing an xsl transform?

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?

like image 636
Zaz Avatar asked Oct 01 '10 14:10

Zaz


People also ask

Can Chrome be made to perform an XSL transform on a local file?

Show activity on this post. The short answer is "No, use one of the diverse set of browsers out there". The reason this doesn't work is due to a security concern that Chrome has addressed in a controversial way, by blocking XML files from accessing local XSLT files in the same directory, while HTML files can access .

Does Firefox support XSLT?

Note: Since Firefox 7, both text/xsl and application/xslt+xml are supported MIME types for XSLT media stylesheets.


2 Answers

I have a site completely developed with XML, XSLT and XHTML. It does not render in my Android DroidX phone but renders in all the browsers elsewhere. I have no definitive answer as to if this means Android does not support XSLT.

like image 58
Rob Avatar answered Oct 13 '22 01:10

Rob


See Android issue 9312 To summarize: Android browser does not support XSLT client-side until 2.1.

like image 22
rds Avatar answered Oct 13 '22 01:10

rds