Re: Two namespace-questions

"Kai Wörner" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
Thanks, that solved my problems. But wouldn't it be more plausible if
JDOM didn't add xmlns="" to elements without a namespace prefix?

Kai



> > Namespace svg2 = Namespace.getNamespace("http://www.w3.org/2000/svg");
> > svgRoot.setNamespace(svg2);
> >
> > , but using the second one adds a
> >
> > xmlns=""
> >
> > to every Element I create. Is there any comprehensible way to declare
> > the namespaces without getting this?
>
> You have to set the namespace on every element you create, for example using
> the constructor Element(java.lang.String name, Namespace namespace) or
> setNamespace(Namespace namespace).
> JDOM Elements are not linked to their parent and have a namespace of their
> own. Hence, they do not inherit the parent namespace when being added as children.
>
> Laurent
>
>
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
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.