[jdom-interest] Namespace

Szegedi, Attila szegedi at scriptum.hu
Wed Aug 1 04:00:26 PDT 2001


First of all, you're sending mail in HTML format. This is inpolite on
mailing lists.

Your problem will disappear if you use
  new Element("topic", topicMapNS)
instead of
  new Element("topic")


Attila.

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]On
Behalf Of Sparkes, Peter
Sent: Wednesday, August 01, 2001 10:53 AM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] Namespace


Hi,
Namespace topicMapNS =
Namespace.getNamespace("http://www.topicmaps.org/xtm/1.0/");
Element topicMap = new Element("topicMap", topicMapNS);
topicMap.addContent(new Element("topic")
                   .setText("Topic Maps"));
Gives me:
<topicMap xmlns="http://www.topicmaps.org/xtm/1.0/">
  <topic xmlns="">Topic Maps</topic>
</topicMap>
The "xmlns" attribute on element "topic" is not wanted.
Please, what am I doing wrong.
Peter Sparkes




More information about the jdom-interest mailing list