[jdom-interest] Namespace patch

Elliotte Rusty Harold elharo at metalab.unc.edu
Tue Aug 29 11:12:31 PDT 2000


At 7:52 PM +0200 8/29/00, Anli Shundi wrote:
>This is to reiterate my earlier concerns on Namespace declarations
>which get lost.  The current version optimizes and uses namespaces
>only when explicitly needed.  Their declaration should not get lost.
>Digital Signature's Canonicalization algorithm needs them as well.
>http://www.w3.org/TR/xml-c14n
>

The big question is whether anyone cares where the namespace prefixes 
are declared as long as they're declared; i.e. would it matter if a 
namespace declaration moved from a child node to a parent node?

Simply holding on to all namespace declarations is not hard. Making 
sure they stay in one place is hard given the current architecture. 
Doing this seems like it would require a separate 
NamespaceDeclaration class which could be attached to particular 
elements. This would require major changes to Element, Attribute, and 
Namespace.

It might also require changes to how client programmers work with 
JDOM. Right now you can add any element as a child of any other 
element, and any attribute to any element and the namespaces will 
sort themselves out. I'm not sure if we can maintain that simplicity 
if we allow people to directly add namespace declarations.  Maybe we 
can. I need to think about it some more.

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list