是Android浏览器能够执行XSL转换的? [英] Is the Android Browser capable of performing an xsl transform?

查看:93
本文介绍了是Android浏览器能够执行XSL转换的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个XML文件,我想使用XSL文档转换,但我似乎无法让它就连最新的可用的Andr​​oid版本。

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.

我尝试添加一个<?xml样式表/> 标记的XML,但没有无论是在本地浏览器或海豚浏览器的工作。

I tried adding a <?xml-stylesheet/> tag to the xml, but that didn't work in either the native browser or in Dolphin Browser.

例如:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
<xmldata>Hello world</xmldata>

<?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>

应该产生斜体文字,这它在大多数桌面浏览器(Chrome浏览器有一个恼人的共享脚本根的政策,以确保它只有当文件不在一个本地磁盘的工作。) 但它不会在移动浏览器中运行。

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?

推荐答案

默认的Andr​​oid浏览器开始支持XSL转换中,显示了在Android 4.0的版本,冰淇淋三明治。

The default Android Browser starts supporting xsl transforms in the version that shows up in Android 4.0, Ice Cream Sandwich.

其他移动浏览器终于​​开始支持XSL是的Opera Mobile Chrome浏览器Android浏览器,目前处于测试阶段。

Other mobile browsers that have finally started supporting xsl are Opera Mobile and the Chrome Android Browser, currently in beta.

这篇关于是Android浏览器能够执行XSL转换的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆