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: John Cowan <cowan AT ccil.org>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Namespace Mappings
  • Date: Tue, 11 Jan 2005 09:03:07 -0500

Elliotte Harold scripsit:

> The custom namespace map class seems a little more obvious. However an
> element (which in general would not need to be, but could be, the node
> being queried) removes the need for an extra public class.
>
> Anyone want to express a preference here? Or suggest a fourth option?

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.

--
The experiences of the past show John Cowan
that there has always been a discrepancy cowan AT ccil.org
between plans and performance. http://www.reutershealth.com
--Emperor Hirohito, August 1945 http://www.ccil.org/~cowan




Archive powered by MHonArc 2.6.24.

Top of Page