[jdom-interest] output with namespace only on root element

tballen at copart.com tballen at copart.com
Mon Jun 9 11:27:08 PDT 2003

Just for my knowledge, what exactly is the "namespace in scope?"


At 01:31 PM 6/9/2003 -0400, Elliotte Rusty Harold wrote:
>At 12:48 PM -0400 6/9/03, tballen at copart.com wrote:
>>OK.  I think the light bulb over my head just switched on.
>>The child elements do not automatically inherit the namespace of my 
>>*named* namespace ("cprt").
>>Is that right?
>>The example has <y xmlns:"http://foo.com">
>>The z element inherits the "http://foo.com"> namespace *only* because the 
>><y> element does not have a namespace prefix.
>>Is that right?
>Pretty much. It doesn't really inherit anything except the namespaces in 
>scope.  It happens that in the last example the namespace in scope for the 
>empty prefix is http://foo.com
>   Elliotte Rusty Harold
>   elharo at metalab.unc.edu
>   Processing XML with Java (Addison-Wesley, 2002)
>   http://www.cafeconleche.org/books/xmljava
>   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA

More information about the jdom-interest mailing list