0

I am trying my first XSLT transformation. I wrote a simple XML file and a simple XSL file which lists elements in a table. I created the files using the eclipse IDE and the transformation was complete to XML. i.e. I got an out.xml file which contained the corresponding html code correctly. How can I run this file on the server to view the output of the html file on the browser instead?

Is there a way of specifying to the XSL file to open in the browser? maybe in the href part where I link the XML with the XSL?

I tried this:

<?xml-stylesheet type="text/xsl" href="http://8089/Transformations/BookStore.xsl"?>

where 8089 is the port where I am running my tomcat server, Transformations is the name of the project and BookStore.xsl is the XSL stylesheet.

However after doing that, it's still opening in the file. Am I doing something wrong?

Thanks :)

4

1 回答 1

2

如果 Tomcat 正在侦听端口 8089,则 URL 应该类似于

http://localhost:8089/Transformations/BookStore.xsl

如果您知道两者的相对位置,通常使用相对 URI 从 XML 指向 XSLT 会更简单。

于 2013-01-31T23:35:51.217 回答