搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Can firefox translate an XML document using XSLT to get a SVG document and display it?

  • 4 个回答
  • 3 人有此问题
  • 12 次查看
  • 最后回复者为 Tombombadil

more options

I can get firefox to use xslt to translate an XML document to HTML and display the result but I can't get it to translate it to SVG and render the graphic. I can use the same XML and XSLT outside firefox to produce the SVG file and firefox displays it fine. Should this be possible?

I can get firefox to use xslt to translate an XML document to HTML and display the result but I can't get it to translate it to SVG and render the graphic. I can use the same XML and XSLT outside firefox to produce the SVG file and firefox displays it fine. Should this be possible?

所有回复 (4)

more options

A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See http://forums.mozillazine.org/viewforum.php?f=25

more options

Hi, I had the same problem (with the additional constraint that I want to include the svg into a html page).

You will have to create a XSLT 1.1 Stylesheet (as FF 6.0.2 does not support XSLT 2.0)

  • ) Make sure that you set a size for your SVG graphic (I tried to embed the svg in a table and the column collapsed to 0 px - and i could not see the svg graphic)
  • ) set the xmlns in the svg tag:

<svg height="100%" version="1.1" viewBox="0 0 600 400" xmlns="http://www.w3.org/2000/svg">

  • ) a <svg><style>.. css style definition</style></svg> does not work if there is a style definition in the html section! You must define the svg styles in the single <style> </style> tag


Tip: Try to keep the xslt quite simple and add more complexity after a simple example works!

If you need a simple example to start working with that just post again here (then I will take the time to create a simpler version of what I have done).

Good luck and have fun :)

由Tombombadil于修改

more options

Thanks.

After the post from cor-el I posted my question to mozillaZine forum. It turned out I was using XSLT 2.0 functions. I don't want to simplify my xslt (or make it even more complicated by using only xlst 1.1 function). So I am going to wait until firefox support XSLT 2.0.

more options

For my project I use a combination of server-side XSLT 2.0 and client side XSLT 1.0 - mainly for exploring a different approach then because this is a clever solution ;)

Do you know anything about when XLST 2.0 will be supported? It can be a while until FF or any other browser for that matter will support XSLT 2.0...

Good luck with your project anyways!