[jdom-interest] namespace definitions should not be omited

Anli Shundi anli.shundi at nue.et-inf.uni-siegen.de
Thu Jul 27 11:04:31 PDT 2000


The current JDOM doesn't allow for identical replication of XML documents
because it loses track of namespace definitions.

The problem arises when encountered namespace declarations are stored
temporarily in org.jdom.input.SAXBuilder.namespaceDefinitions and then
passed to the appropriate elements and attributes as Namespace-s.

Example:

<doc xmlns:ns1="http://1.2.3">
   <ns1:a/>
</doc>

can currently be translated only as

<doc>
   <ns1:a xmlns:ns1="http://1.2.3" />
</doc>

A fix would be to add a list of Namespace definitions for elements
where the namespaces are declared.  The printer/outputer would then decide
whether to output the namespace where first declared (verbatim replication)
or where first used (current implementation).

I hope this is not outside your vision of JDOM.  It would otherwise
make JDOM unsuitable for XML-Digital Signatures (Canonicalization requires
such replication ...)

Best wishes,

Anli Shundi
Institute for Data Communications Systems
University of Siegen
Germany






More information about the jdom-interest mailing list