Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to define multiple namespaces using DOM?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to define multiple namespaces
in my root element (using DOM).
I tried this, but when I excecute this
code, only the first declaration exists
in the serialized xml document:
root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:a", "http://www.someHost.com/a";);
root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:b", "http://www.someHost.com/b";);
How can this be done? thanks
 
Stephanie Smith
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
User error. THis works as expected by just calling setAttributeNS() multiple times.
 
    Bookmark Topic Watch Topic
  • New Topic