Java Mailing List Archive

http://www.junlu.com/

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

Re: [jdom-interest] empty xmlns

Elliotte Rusty Harold

2004-01-09

Replies:

At 9:59 AM +0000 1/9/04, <christopher.faulkner@(protected):


>When I create MyFavourite with the Element constructor, I am not
>adding a Namespace or any type of attribute so why is it there ?


That's exactly why it's there. You created an element that is in no
namespace. Because the parent element is in a namespace, the
serializer must add xmlns="" to the child element to prevent it from
inheriting the default namespace of its parent. If you don't want the
child to be in a namespace, this is correct. If you do want the child
element to be in a namespace, you need to specify this namespace URI
in the Element constructor.
--

 Elliotte Rusty Harold
 elharo@(protected)
 Effective XML (Addison-Wesley, 2003)
 http://www.cafeconleche.org/books/effectivexml
 http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA
_______________________________________________
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.