Re: [xml-dev] Namespace declaration using DOM
Christian Nentwich wrote: > >><RootElement xmlns:c="http://pradeepbhat.com"> >><c:name>pradeep</c:name> >><RootElement> >>My problem is how to put the xml name space declaration in RootElement. >>Some one plz help; > > > root.setAttribute("xmlns:c","http://pradeepbhat.com"); > I don't think this is correct. Namespaces are *not* attributes. You'll have to create the c:name element using createElementNS("http://pradeepbhat.com","c:name"); (there may be other possibilities) J.Pietschmann