xsl:copy-of works for copying elements, but they do not get displayed in SVG

RESOLVED INVALID

Status

()

Core
SVG
RESOLVED INVALID
12 years ago
12 years ago

People

(Reporter: Maciej Jaros, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

I thought that it was a bug in XSLT, but it doesn't seem so...

What I wanted to do is to simply copy part of an XML document and display it with as an SVG image (i'll post a test case in a minute). The elements didn't got displayed, but when I viewed the generated source it was all there.

That's about it, but just to note - <xsl:copy-of...> works if the document is outputed as a HTML (just tried to copy the contents of a table).

Reproducible: Always

Steps to Reproduce:
1.View XML
(Reporter)

Comment 1

12 years ago
Created attachment 240036 [details]
XML file to be transformed
(Reporter)

Comment 2

12 years ago
Created attachment 240037 [details]
XSLT that should display two circles (displays one that is in XSLT, not the one that is copied)
I think you have the xmlns='http://www.w3.org/2000/svg' in the wrong place. It needs to be part of the <svg> element that you output.
(Reporter)

Comment 4

12 years ago
I belive I tried all possible variations including
<xsl:element name="svg" namespace="...">
</xsl:element>
But I'm not 100% sure, so one might check on that.

Besides if one circle gets displayed then I belive they all should.
(Reporter)

Comment 5

12 years ago
Created attachment 240626 [details]
kind of a workaround stylesheet for people that want to copy some contents as SVG

I've just tried to add the namespace inside svg element, but both versions give me this (viewed as a generated source):

<svg xmlns="http://www.w3.org/2000/svg" width="200px" height="200px"><circle cx="10" cy="10" r="5"/><circle cx="30" cy="10" r="5"/></svg>

Interesting thing is that this bug is also in Opera... That's why I've checked XSL recomendation and it is not really clear about that to me, but it seems that the copied circle have no namespace as it have no namespace in the original XML document...

Anyway after some experiments I've found that there is way to make it work. So I'm creating this attachment.
(Reporter)

Comment 6

12 years ago
Created attachment 240627 [details]
Another XML that works with the XSL attached above.
(Reporter)

Comment 7

12 years ago
OK. After an explanation from one of XSL recommendation editors I found that this is not a bug really as the first XML file must be transformed to:
<svg xmlns="http://www.w3.org/2000/svg" width="200px" height="200px">
     <circle cx="10" cy="10" r="5"/>
     <circle xmlns="" cx="30" cy="10" r="5"/>
</svg>

Still when I put the namespace into the XML doucument it doesn't work as I would like, but as there is also a way to make it work, then I guess I can live with that ;).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.