Re: Problem using a script to insert a <use> element
Jonathan Watt <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.svg |
|---|---|
| Message-ID | <[email protected]> |
On 7/19/09 3:19 AM, Boris Zbarsky wrote:
> Tetra wrote:
>> Is it possible to do this? The attached file successfully adds a <rect>
>> element, but then fails to add a <use> element with the exact same method.
>
> You're using:
>
> y.setAttribute('xlink:href', '#wtf')
>
> That's wrong. Welcome to XML namespaces!
>
> You need to use setAttributeNS with the right namespace:
> "http://www.w3.org/1999/xlink".
You may also find this doc useful:
http://jwatt.org/svg/authoring/#namespace-aware-methods