XSL模板中的特征检测 [英] Feature detection in XSL template

查看:85
本文介绍了XSL模板中的特征检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在模板中检测到任何UA的功能?


我有一个XML数据文件,其中XSL模板链接有HTML页面

输出。我希望在转换过程中做一些调整

,具体取决于目标UA,比如添加xmlns:v =" urn:schemas-microsoft-com:vml"

to IE的HTML元素。


或XSLT变换器不包括这样的选项(仅产生

文件暂停环境)?

Is there any possibility to detect any of UA''s feature in the template?

I have an XML data file with XSL template linked having HTML page as
output. I would love to make some adjustments during the transformation
depending on target UA, say add xmlns:v="urn:schemas-microsoft-com:vml"
to html element for IE.

Or XSLT transformer exludes such option as such (only resulting
documents gets on hold of the environment)?

推荐答案




VK写道:


VK wrote:
有没有是否可以在模板中检测任何UA的功能?
Is there any possibility to detect any of UA''s feature in the template?




您可以使用

< http来检测XSLT中的XSLT处理器://www.w3.org/TR/xslt#function-system-property>

例如

< xsl:if test =" system-property(' 'xsl:vendor'')=''微软''">


到目前为止,有几款来自微软的XSLT处理器产品,

几个MSXML版本(3,4,5,6)和两个.NET版本(XslTransform,

XslC ompiledTransform)所以简单地检查供应商可能不会告诉你

足够。

-


Martin Honnen
< a rel =nofollowhref =http://JavaScript.FAQTs.com/target =_ blank> http://JavaScript.FAQTs.com/




VK写道:

VK wrote:
是否有可能在模板中检测到任何UA的功能?
Is there any possibility to detect any of UA''s feature in the template?




不,在XSLT处理器之外测试它们并将标志传递到

样式表。


这是一个很好的方法(特别是在ASP下的M



No, test for them outside the XSLT-processor and pass a flag into the
stylesheet.

This is a good approach (particularly with the M


oft工具)

,因为它仍然允许你缓存加载(慢)样式表而只是

根据需要重复(快速)转换。


不要错误地假设测试

XSLT处理器(你的功能)当然可以)告诉你关于

最终客户的功能查看输出。这只是客户端转换(最多)的

案例

oft tools under ASP)
because it still lets you cache loading the (slow) stylesheet and just
repeat the (quick) transformation as needed.

Don''t make the mistake of assuming that testing for features of the
XSLT processor (which you can certainly do) tells you anything about
the features of the final client viewing the output. That''s only the
case for client-side transforms (at most)


这篇关于XSL模板中的特征检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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