Can firefox translate an XML document using XSLT to get a SVG document and display it?
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?
All Replies (4)
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.
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 :)
Novain'i Tombombadil t@
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.
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!