[jdom-interest] output with namespace only on root element
Elliotte Rusty Harold
elharo at metalab.unc.edu
Mon Jun 9 10:31:17 PDT 2003
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