Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Funkcjonalność tej witryny będzie ograniczona w czasie konserwacji. Jeśli artykuł nie rozwiązuje twojego problemu i chcesz zadać pytanie, to nasza społeczność wsparcia jest dostępna na @FirefoxSupport na Twitterze i /r/firefox na Reddicie.

Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Więcej informacji

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

  • 4 odpowiedzi
  • 3 osoby mają ten problem
  • 12 wyświetleń
  • Ostatnia odpowiedź od 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?

Wszystkie odpowiedzi (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 :)

Zmodyfikowany przez Tombombadil w dniu

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!