Search code examples
xmlxpathxqueryxqilla

Restricting XQuery to XPath


I've got an app that manages collections of XML files and allows querying using XPath, to allow users to view subsets of collections that match an XPath query.

For various technical reasons, I'm switching to an XQuery engine. I understand that XQuery is a superset of XPath. However, I don't want full XQuery functionality because users may use it to construct new XML objects that don't match my DTD and can't be displayed by my SVG-based viewer.

Can I easily validate query strings as XPath and hand them off to the XQuery engine? Or can I convert them in a simple way?

(I'm using C++ and switching to XQilla.)


Solution

  • XQilla did turn out to have an XPath 2.0 parser, so I'm using that now.