how to handle textPath in svg

Poster Content
nk4um User
Posts: 131
August 26, 2008 11:43Thanks
As always an excellent response Menzo. Next time I''m in Amsterdam I''ll buy you a beer (or whatever your poison is ;-) !

Like · Post Reply
nk4um User
Posts: 111
August 26, 2008 09:39
Even an SVG document has to be a valid XML document, so the xlink namespace has to be declared. So just add it to your svg root element:

<svg width="100%" height="100%" version="1.2" xmlns="" xmlns:xlink="">

See also the "Example: XLink namespace declaration" at:

where just above the following text can be found:

In all cases, for compliance with either the "Namespaces in XML 1.0" or the "Namespaces in XML 1.1" Recommendation [XML-NS10][XML-NS], an explicit XLink namespace declaration must be provided whenever one of the above XLink attributes is used within SVG content. One simple way to provide such an XLink namespace declaration is to include an xmlns attribute for the XLink namespace on the ''svg'' element for content that uses XLink attributes.

There is no escape ;-)

Hope this helps,

Like · Post Reply
nk4um User
Posts: 131
August 26, 2008 08:57how to handle textPath in svg
In my XRLlinks.xml I have the following :

This works fine as long as busy.svg is very simple. However, when it gets a bit more complex, like ...

<svg width="100%" height="100%" version="1.2" xmlns="">
  <path id="theCircle" d="M20,45 C20,10 70,10 70,45 M70,45 C70,80 20,80 20,45"/>

<circle cx="45" cy="45" r="40" stroke="black" stroke-width="2" fill="red"/>
<text style="font-size:14;font-family:verdana">
   <textPath xlink:href="#theCircle">Busy-Busy-Busy-Busy-

It throws the typical sax error ...
The prefix "xlink" for attribute "xlink:href" associated with an element type "textPath" is not bound.

I "understand" why that is, but on the other hand ... this is valid SVG-syntax ... so how can I write my statement so the imageSVG2PNG-parser gets my input without going through the sax-parser first ?

Like · Post Reply