xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] New XPath issue: what to do with non-nodes?
- From: John Cowan <cowan AT ccil.org>
- To: Elliotte Harold <elharo AT metalab.unc.edu>
- Cc: xom-interest <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:13:17 -0500
Elliotte Harold scripsit:
> Given that XOM is written in Java, type-safe results are simply not an
> option. The language doesn't support them. There's just no way in Java
> to return a type-safe list that can potentially contain any or all of
> node-sets, doubles, booleans, and strings.
Arrgh.
(sinking deeper and deeper into the quicksands of absolute inertia)
IT DOESN'T HAVE TO.
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.
This is orthogonal to the question of how to handle XPath nodes
that contain multiple XOM Text objects.
--
Time alone is real John Cowan <cowan AT ccil.org>
the rest imaginary http://www.reutershealth.com
like a quaternion --phma http://www.ccil.org/~cowan
-
[XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Nils_Kilden-Pedersen, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
John Cowan, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Wolfgang Hoschek, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/12/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Wolfgang Hoschek, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/12/2005
-
RE: [XOM-interest] New XPath issue: what to do with non-nodes?,
Michael Kay, 01/13/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Michael Abato, 01/13/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, John Cowan, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Bradley S. Huffman, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Elliotte Harold, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, John Cowan, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Elliotte Harold, 01/13/2005
- RE: [XOM-interest] New XPath issue: what to do with non-nodes?, Michael Kay, 01/13/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Elliotte Harold, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, John Cowan, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Wolfgang Hoschek, 01/13/2005
- RE: [XOM-interest] New XPath issue: what to do with non-nodes?, Michael Kay, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Wolfgang Hoschek, 01/13/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Michael Abato, 01/13/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Wolfgang Hoschek, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
John Cowan, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Elliotte Harold, 01/12/2005
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?,
Nils_Kilden-Pedersen, 01/12/2005
Archive powered by MHonArc 2.6.24.