xlink

Discuss SVG code, accessible via the XML Editor.
Gnosos
Posts: 1
Joined: Tue Mar 18, 2008 6:42 am

xlink

Postby Gnosos » Tue Mar 18, 2008 7:08 am

Hi,

I just wasted a bit over an hour tracking down a problem with the SVG code Inkscape generates. I created a figure in Inkscape and then tried to display the SVG file in a web page. Firefox kept giving me an error message, "XML Parsing Error: prefix not bound to a namespace." After moving the file around to different locations, changing path variables, etc., I searched the web for the error and found this entry -- Why does Mozilla show source code/gibberish instead of SVG? -- on this page: Top

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: xlink

Postby microUgly » Tue Mar 18, 2008 9:04 am

Sounds like even though it's not a required attribute, it's doesn't hurt to have it there (for the sake of having it work in all situations). If you don't get an answer here you might like to try the developers mailing list. But before you do, check and see if this has already been reported on the Inkscape Launchpad site.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: xlink

Postby sas » Tue Mar 18, 2008 9:12 am

Gnosos wrote:Judging from the comments on the mozilla web page, every SVG file should have the xlink element.

That's not quite true. The xmlns:xlink="http://www.w3.org/1999/xlink" binds the prefix 'xlink' to the XLink namespace. There are many SVG files that use the XLink namespace (since it's needed for various things, such as text-on-path and bitmap images), but there are also many that don't use it at all, and therefore have no need for xmlns:xlink="http://www.w3.org/1999/xlink".

So, is there any good reason why Inkscape doesn't automatically include this in the svg element of ALL files created with Inkscape?

I think it used to, but nowadays it appears to only write it when it's needed. If it failed to include when it was needed, you should file a bug report.


Return to “SVG / XML Code”