[jdom-interest] Namespaces and SAXBuilder

Brett McLaughlin brett.mclaughlin at lutris.com
Thu Oct 12 11:46:21 PDT 2000


Hey guys-

  News from the front; I've got a significant fix in place for
namespaces.

First, on Element.java, there are two new methods:

public void addAdditionalNamespace(Namespace additionalNamespace);

public List getAdditonalNamespaces();

These allow additional namespaces to be declared on an element; it is
clear from the name of the method, and the Javadoc, that these methods
do not return the namespace of the element itself, which is handled as
it always has been. These are strictly for /additional/ namespaces
declared on an element.

Second, in SAXBuilder.java, I've made changes to use these methods. I
believe that it handles both the case where a namespace is declared but
never used, and where a namespace is declared on an element, but only
the children use that namespace. Previously, the declarations would be
output on each child, but now it stays on the parent.

Finally, I've made changes to XMLOutputter to output these namespaces. 

I've also modified samples/contents.xml to have both unused namespaces
and a namespace on a parent that is only used by the children. 

I have NOT modified DOMBuilder yet, because I'm not 100% sure my changes
are 100% correct. I'd like to have some folks check out from CVS and try
it out; particularly, I'd like testing in areas where default namespaces
are used multiple times, as that can be problematic. I have to go run
some errands this afternoon, but will look at it more tonight. So let me
know. Also, if anyone can use this to submit a patch on DOMBuilder, I'm
more than happy to let someone else do that work ;-)

Let me know - it's all in CVS now.

-Brett


-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list