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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.