[jdom-interest] Namespace.hashcode patch

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu May 31 06:17:46 PDT 2001


> In the first case maybe the outputters shoud look for declarations
> of the namespace higher in the tree and just pick a prefix already
> maped to this namespace, or if this is the default namespace at this
> point not add a prefix att all. If there is no prefix declared for
> this namespace this will eiter be an errorcase or the outputter
> creates an unused prefix "P1, P2 ..." for the namspace and adds
> namespace declaration using this prefix.
>

This will not work.  In SOAP and other xml applications the prefix is quite
significant.  A prefix used in one element is part of an attribute value
later and the processor ties them together that way.  Namespaces without
prefixes cannot just have a new one added because the default namespace has
special meaning in xml.
 
> In the second case simply output the prefix and if the prefix is
> not already declared to this namespace delcare it.
> 
> I think we somehow need a NamespacePrefix class so we can
> separate a namespace from its prefix when creating documents.

I think this overly complicates the api in an area that few people care
about at all.  I think we should just hold out and see if the objection to
hashcode can be resolved.



More information about the jdom-interest mailing list