Hi Mike!

> Scanning the document in this case is not an option, and as namespaces
> may be removed, and content shared within the document, maintaining a
> map of usage is not trivial in code, CPU or memory.

I do not want to scan the document to build the list of namespaces. The
add(Namespace) method of AbstractElement could add each new namespace to
the specific new XPathNamespaces object which is declared at the
document (in my addition).

> I would suggest that any code that determines namespace could use a
> namespace resolution strategy that is appropriate for its needs, and
> this should be able to be defaulted without code.
> This is what the DefaultNamespaceContext does, albeit without strategy
> options, but any progreammer can withthe 1.6.1 implementation provide
> a different namespace context, appropriate for their needs, and what
> you are proposing is such an alternative I believe

What is needed is a NamespaceContext (but at best not only for jaxen,
but that is an other point) which holds all namespaces that are declared
in the document. And what is needed is code to collect this namespaces
in creation of the document.

The Problem with only add namespaces to the document with
add(Namespaces) is in adding of branches. To solve this there might be
1) a more complex strategy to hold namespace declarations for each branch
2) retrieval of all namespaces from the branch while adding
3) add all namespaces of the document of the branch (if it comes from an
other document), because more namespaces than needed should not be a
problem

For me point 3 would be enough.

> see AbstractElement.getNamespaceForPrefix, and
> DefaultElement.getNamespaceForPrefix

I do not see how this could help?


-- 
Viele Grüße / best regards

Marc Pellmann (Software Architect)

inubit - integrating your business and IT
inubit AG
Schöneberger Ufer 89-91
D-10785 Berlin
Fon: +49.30. 72 61 12-132
Fax: +49.30. 72 61 12-100
Freecall: 0800-go inubit
Web: www.inubit.com

Vorstand: Dr. Torsten Schmale
Vorsitzender des Aufsichtsrates: Dr. Wolf-Dieter Klemt
Registergericht: AG Charlottenburg
Registernummer: HRB 80154
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to