How to implement xsl

与世无争的帅哥 提交于 2019-12-24 04:16:15

问题


I'm new to all of this, and I've been searching like hell, and can't find any guide that assumes little prior knowledge. So if you could keep answers as simple as possible, that would be great for us newbies :)

I have a document, xml.xml, that I would like to transform using another file called xslt.xsl

I've used the W3schools tryit editor to get the code for both files.

Now how do I get them to work together on my computer?

I've tried adding

<?xml-stylesheet type='text/xsl" href="http://www.dansitrepairs.com/XSLT.xsl"?>

to the second line of my xml file, but it doesn't work.

I've tried linking it in Dreamweaver and msxsl too. Clearly I must have ignored something important, because it shouldn't be this hard (I don't think)

Thanks

Added

As outilined in the comments, it was partly due to a typo in the code I provided, namely type='text/xsl" should be double quoted.

However, it only works when both files are local. When the xsl reference is on a server, I get this instead of what I want:

Added #2

It probably is a cross-origin policy implemented on your browser. It should work when both files are on a server on the same domain.

This was the other problem


回答1:


It probably is a cross-origin policy implemented on your browser. It should work when both files are on a server on the same domain.



来源:https://stackoverflow.com/questions/20902186/how-to-implement-xsl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!