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: Wolfgang Hoschek <whoschek AT lbl.gov>
- To: "Michael Kay" <mike AT saxonica.com>
- Cc: 'Elliotte Harold' <elharo AT metalab.unc.edu>, 'John Cowan' <cowan AT ccil.org>, '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 16:42:22 -0800
On Jan 13, 2005, at 3:41 PM, Michael Kay wrote:
Just for illustration: Nux has an interface "ResultSequence". Its
intent corresponds to such an XPathResult class.
Currently it only has methods "Nodes toNodes()" (corresponding to
nodeListValue()), and "Node next()" to get the next node of the
sequence.
I think it's a really bad idea to combine a collection and an iterator over
that collection in a single object. It means that when you have a method
that takes two collections as arguments and compares them, the method fails
abysmally when you compare a collection to itself.
ResultSequence is not a collection. It's just a forward-only iterator (over another saxon iterator). toNodes() iterates until the end and collects all results into an independent Nodes object. next() produces the next Node of the iterator. Does that address your concern?
(Sadly, the people developing the XQJ API seem to be making this mistake).
-
Re: [XOM-interest] New XPath issue: what to do with non-nodes?
, (continued)
- 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?, 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?, Bradley S. Huffman, 01/17/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?, Michael Kay, 01/13/2005
- Re: [XOM-interest] New XPath issue: what to do with non-nodes?, Elliotte Harold, 01/13/2005
Archive powered by MHonArc 2.6.24.