是否有使用Client XSLT的大型网站? [英] Any big sites using Client Side XSLT?

查看:87
本文介绍了是否有使用Client XSLT的大型网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我一直在考虑在服务器端构建原始XML,然后在客户端上使用XSLT样式表将XML转换为完整UI的某种非主流架构.当然,如果客户端没有客户端XSLT的能力,就必须有一个后备机制,在这种情况下,我们只需要在服务器端对其进行转换即可.

Lately, I've been pondering the somewhat non-mainstream architecture of building raw XML on the server side, and then using an XSLT stylesheet on the client to transform the XML into the full UI. Of course, a fallback mechanism would have to exist if the client was not capable of client side XSLT, in which case we'd just transform it for them on the server side.

我已经非常熟悉XSLT,这种方法似乎完全是将表示和内容分离开来,将数据完全强制为XML,并使用XSLT进行表示.

I'm already intimately familiar with XSLT, and this approach seems to be a clean separation of presentation and content, completely forcing the data into XML, and using XSLT for presentation.

我还知道,这确实给应用程序增加了一层额外的复杂性,这只是可能会失败的另一个动态部分.

I'm also aware that this does add an extra layer of complexity to the application, which is just another moving part that can fail.

我的问题是:是否有使用这种方法的大牌或大流量站点,如果是这样:您从中获得了哪些限制/经验教训?

My question is: are there any big name or big traffic sites using this approach, and if so: what limitations/lessons learned did you take away from it?

感谢互联网, 扎克

推荐答案

就像其他人提到的那样,暴雪有很多站点都是客户端xsl.我建议避免使用客户端xsl.这是一个很酷的主意,但是您需要解决许多不寻常的错误.

Like other people have mentioned, Blizzard has many sites that are client side xsl. I would recommend avoiding client side xsl. It is a really cool idea, but there are many unusual bugs that you need to work around.

在Firefox中,任何使用document.write的JavaScript都将破坏DOM.另外,firefox的noscript插件会停止客户端xsl.在这两种情况下,用户都不会看到任何内容.似乎没有一种方法可以检测到这种错误,因此无法进行回退.

In Firefox, any javascript that uses document.write will destroy the DOM. Also, the noscript plug-in for firefox stops client side xsl. In both cases, the user will see nothing. There doesn't seem to be a way to detect this kind of error, so a fall back will not work.

在IE中,如果您进行30倍重定向到其他来源(从http到https或跨子域)的内容,则会因违反 http://foo.example.com/login ,则操作为302重定向到 https://bar.example.com/login.xml ,IE将处理xsl就像它来自bar.example.com,并且会将xml视为来自foo.example.com.因此,您将需要恢复到诸如元刷新之类的重定向.

In IE, if you have anything that does a 30x redirect to something of a different origin (going from http to https or crossing sub domains), you will get an error for violating the same origin policy. You did not really violate the same origin policy, but IE acts like you did. For example, if you go to http://foo.example.com/login and that does a 302 redirect to https://bar.example.com/login.xml, IE will treat the xsl as if it came from bar.example.com and it will treat the xml as if it came from foo.example.com. So you will need to revert to something like a meta refresh for your redirects.

这些是我想到的东西.这是一个好主意,但请注意这些问题.

These are the things that I came up with off the top of my head. It is a neat idea, but be aware of these issues.

这篇关于是否有使用Client XSLT的大型网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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