Re: Adding a namespace to a Dom document

Marina Dorelli <[email protected]> Wed, 26 May 2010 00:16:46 +0200
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
I used:
wbp.saveDocument(content.document,localFile,null,"text/xml",null,null);
Is it wrong?

On Tue, May 25, 2010 at 9:59 PM, Boris Zbarsky <[email protected]> wrote:

> On 5/25/10 3:36 PM, Marina Dorelli wrote:
>
>> so I should use root.setAttributeNS("http://www.w3.org/2000/xmlns/",
>> "xmlns:foo",
>> "http://foo.org#"); , no?
>>
>> I've tried this way but it doesn't work, I saved my document and i can't
>> find the attribute I set
>>
>
> How did you save it?  This works fine over here:
>
>  var doc = document.implementation.createDocument(null, null, null);
>  var elm = doc.createElement("root");
>  doc.appendChild(elm);
>  elm.setAttributeNS("http://www.w3.org/2000/xmlns/",
>
>                     "xmlns:foo","http://foo.org#");
>  var str = (new XMLSerializer()).serializeToString(doc);
>  alert(str);
>
>
> -Boris
>
> _______________________________________________
> dev-tech-dom mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-dom
>