Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] Namespace Mappings

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Hallvard Trætteberg <hal AT idi.ntnu.no>
  • To: <xom-interest AT lists.ibiblio.org>
  • Subject: RE: [XOM-interest] Namespace Mappings
  • Date: Tue, 11 Jan 2005 22:49:47 +0100

> From: John Cowan <cowan AT ccil.org>
>
> I believe a custom namespace map class (call it XPathContext) is much
> better. Using an Element is a little perverse, especially when the
> Element is being used just to hold namespaces and has no role in
> the document. In addition, an XPathContext can be eventually extended
> to support variables and the other things XPath allows, whereas adding
> those APIs to an Element would make little or no sense.
>
> It would be reasonable, however, to have an XPathContext constructor
> that takes an Element and copies the namespace bindings out of it.

Another possibility is to define an interface for (read-only) namespace
mapping that Element could implement, in addition to a custom (writable)
implementation. The custom one could have a parent, so you could define a
mapping based on an Element (or another namespace map) and add other
prefixes, particularly for the default/empty namespace.

Hallvard





Archive powered by MHonArc 2.6.24.

Top of Page