본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

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!