Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] New XPath issue: what to do with non-nodes?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • To: John Cowan <cowan AT ccil.org>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] New XPath issue: what to do with non-nodes?
  • Date: Thu, 13 Jan 2005 09:19:49 -0600

John Cowan writes:

> The value of an XPath 1.0 expression is any ONE of the following:
>
> 1) A double
> 2) A string
> 3) A boolean
> 4) A list of nodes.
>
> There is no problem in handling this pattern in a type-safe way.
> You just need an XPathResult class with four extraction methods:
> double doubleValue(), String stringValue(), boolean booleanValue(),
> and Nodes nodelistValue().
>
> No lists containing things other than nodes are required.

I like this solution, but for some reason I though it was shot down
(more likely it's my brain cells shuting down again).

> This is orthogonal to the question of how to handle XPath nodes
> that contain multiple XOM Text objects.

Actually I was playing last night and I think the idea of a non-public
internal subclass of Text will work. I wrote the code, which wasn't as
tricky as I thought. I just need to test it.

Brad




Archive powered by MHonArc 2.6.24.

Top of Page