Hi John,

I went ahead and merged the two interfaces. Could you please
review the result (and notes below) to see if it's good enough
for XQilla:

http://codesynthesis.com/~boris/tmp/DOMXPathResult.hpp

The overall goal of the merger is to come up with an interface that
can serve both XPath 1.0 and XPath 2.0 (so that we can return
DOMXPathResult* instead of void* from DOMXPathExpression::evaluate())
even though the semantic can be quite different in some cases
(e.g., XPath 2.0 can have a result which is a sequence of strings
while XPath 1.0 can only have a sequence of nodes).

Here is a list of changes:

- add FIRST_RESULT, ITERATOR_RESULT, and SNAPSHOT_RESULT to
  resultType enum

- add getTypeInfo()

- add NO_RESULT_ERROR code to DOMXPathException which is used
  instead of INVALID_STATE_ERR in get*Value() function.

- add getIntegerValue()

- rename getSingleNodeValue() to getNodeValue()

- change iterateNext() and snapshotItem () to return bool instead
  of const DOMNode*

I also left out the isNode() function that is present in DOMXPath2Result.
I am not sure it is needed (and if it is, why there is no isBoolen(),
isString(), etc.).

Finally, I am wondering why the DOM node returned by getNodeValue()
(and asNode()) is const? Finding nodes with XPath and then modifying
them sounds like a perfectly reasonable idea (in fact not long ago I
wrote a small XML Scheam simplifier which needed this so I had to
resort to const_cast). Plus it is fairly easy to "break out" of
constness in DOM (e.g., getParentNode() is const and returns non-
const node). Are there any problems with returning non-const node?

Thanks,
Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to