Closed Bug 354172 Opened 18 years ago Closed 18 years ago

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

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: egil, Unassigned)

Details

Attachments

(4 files)

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
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.
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.
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.
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
Closed: 18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: