Boris Kolpackov wrote:
Having given it some thought, I think that merging the two would be the
best idea - it would be a breaking change for XQilla users, but it would
be a move to a more standard API.
Agree. If you can come up with a patch, I will review and commit it.
I've attached a patch against the SVN trunk for the XPath API changes
we've discussed.
John
--
John Snelson, Oracle Corporation http://snelson.org.uk/john
Berkeley DB XML: http://oracle.com/database/berkeley-db/xml
XQilla: http://xqilla.sourceforge.net
Index: src/xercesc/dom/DOMXPathNSResolver.hpp
===================================================================
--- src/xercesc/dom/DOMXPathNSResolver.hpp (revision 652795)
+++ src/xercesc/dom/DOMXPathNSResolver.hpp (working copy)
@@ -95,14 +95,21 @@
*
* XPath2 implementations require a reverse lookup in the static context.
* Look up the prefix associated with the namespace URI
- * The XPath evaluator must never call this with a null or empty argument,
- * because the result of doing this is undefined.
* @param URI of type XMLCh - The namespace to look for.
* @return the associated prefix or null if none is found.
*/
virtual const XMLCh* lookupPrefix(const XMLCh* URI) const = 0;
+ /**
+ * Non-standard extension
+ *
+ * Associate the given namespace prefix to the namespace URI.
+ * @param prefix of type XMLCh - The namespace prefix to bind.
+ * @param URI of type XMLCh - The associated namespace URI.
+ */
+ virtual void addNamespaceBinding(const XMLCh* prefix, const XMLCh* uri) =
0;
+
//@}
};
Index: src/xercesc/dom/DOMXPathEvaluator.hpp
===================================================================
--- src/xercesc/dom/DOMXPathEvaluator.hpp (revision 652795)
+++ src/xercesc/dom/DOMXPathEvaluator.hpp (working copy)
@@ -114,11 +114,13 @@
* information available in the node's hierarchy at the time
lookupNamespaceURI
* is called. also correctly resolving the implicit xml prefix.
* @param nodeResolver of type <code>DOMNode</code> The node to be used as
a context
- * for namespace resolution.
+ * for namespace resolution. If this parameter is null, an unpopulated
+ * <code>DOMXPathNSResolver</code> is returned, which can be populated
using the
+ * Xerces-C extension
<code>DOMXPathNSResolver::addNamespaceBinding()</code>.
* @return <code>DOMXPathNSResolver</code> The object which resolves
namespaces
* with respect to the definitions in scope for the specified node.
*/
- virtual const DOMXPathNSResolver* createNSResolver(const DOMNode
*nodeResolver) = 0;
+ virtual DOMXPathNSResolver* createNSResolver(const DOMNode
*nodeResolver) = 0;
/**
Index: src/xercesc/dom/DOMXPathResult.hpp
===================================================================
--- src/xercesc/dom/DOMXPathResult.hpp (revision 652795)
+++ src/xercesc/dom/DOMXPathResult.hpp (working copy)
@@ -29,6 +29,7 @@
class DOMXPathNSResolver;
class DOMXPathExpression;
class DOMNode;
+class DOMTypeInfo;
/**
* The <code>DOMXPathResult</code> interface represents the result of the
@@ -254,13 +255,33 @@
// -----------------------------------------------------------------------
/** @name Non-standard Extension */
//@{
+
+ /**
+ * Returns the integer value of this result
+ * @return numberValue
+ * The value of this numeric result. If the native numeric type of the
DOM
+ * binding does not directly support the exact integer result of the
XPath
+ * expression, then it is up to the definition of the binding to
specify how
+ * the XPath number is converted to the native binding integer.
+ * @exception DOMXPathException
+ * TYPE_ERR: raised if resultType is not NUMBER_TYPE.
+ */
+ virtual int getIntegerValue() const = 0;
+
/**
+ * Returns the DOM type info of the current result node or value.
+ * @return typeInfo of type TypeInfo, readonly
+ */
+ virtual const XERCES_CPP_NAMESPACE_QUALIFIER DOMTypeInfo *getTypeInfo()
const = 0;
+
+ /**
* Called to indicate that this DOMXPathResult is no longer in use
* and that the implementation may relinquish any resources associated
with it.
*
* Access to a released object will lead to unexpected result.
*/
virtual void release() const = 0;
+
//@}
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]