xlink:href turns to href when saving

Bug #230128 reported by franti
2
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Unassigned

Bug Description

I import an SVG file into Inkscape 0.46. It contains two xlink:href attributes, one in a <script> tag the other in an <a> tag.

I save immediately this file as another filename (for purpose of demonstration, it has nothing to do with the way we save).

On reading the new file on an external editor I see the xlink: part of the attribute has disappeared in both tags. As a result neither the script nor the web link function (tested on Adobe SVG). I didn't try with <image>, it probably will behave in the same way.

Here attached : svg file before IS046, script file, svg file after IS046.

Revision history for this message
franti (fhvill) wrote :
Revision history for this message
sas (sas-sas) wrote :

This happens because the namespace prefix 'xlink' hasn't been declared. If you put xmlns:xlink="http://www.w3.org/1999/xlink" into the 'svg' tag, then the 'xlink' prefix has meaning, and Inkscape will preserve it.

So this isn't really a bug. But I think it would be useful if Inkscape could assume that the 'xlink' prefix represents the XLink namespace, unless the SVG file explicitly declares otherwise. I don't know whether it's possible to tell the XML parser to do this.

Your file also fails to specify the default namespace, but Inkscape manages to cope with this, correctly assuming that it should be the SVG namespace. So it would make sense to extend this principle to the XLink namespace.

This is essentially a duplicate of bug 166199, though I hesitate to mark it as such because one of the proposed solutions in that bug is to read the DTD, which wouldn't do any good in this case (since your file doesn't specify a DTD).

jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.