Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] Using xml prefix for an attribute

Bradley S. Huffman

2003-11-25


Morten writes:

> 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",
>   Namespace.getNamespace("xml","http://www.xml.org/"))

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

Brad
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.