[jdom-interest] Using xml prefix for an attribute

Rolf Lear rlear at algorithmics.com
Tue Nov 25 08:37:48 PST 2003


e.setAttribute("lang", "de", Namespace.XML_NAMESPACE)


-----Original Message-----
From: jdom-interest-admin at jdom.org
[mailto:jdom-interest-admin at jdom.org]On Behalf Of Morten
Sent: Tuesday, November 25, 2003 10:59 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Using xml prefix for an attribute


I'm serializing some data to TMX (an XML based format), which requires
an attribute in the xml NS, eg. xml:lang="de". I've tried the following:

Element e = new Element("elem");
e.setAttribute("lang", "de",

But the JDOM complains:

[sauron]~>java test
Exception in thread "main" org.jdom.IllegalNameException: The name "xml" 
is not legal
for JDOM/XML Namespace prefixs: Namespace prefixes cannot begin with 
"xml" in any comb
ination of case.
         at org.jdom.Namespace.getNamespace(Namespace.java:154)
         at test.main(test.java:12)

What to do..?

Thanks in advance,


To control your jdom-interest membership:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20031125/19ca9358/attachment.htm

More information about the jdom-interest mailing list