Reputation: 363807
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.)
Upvotes: 1
Views: 661
Reputation: 363807
XQilla did turn out to have an XPath 2.0 parser, so I'm using that now.
Upvotes: 1
Reputation: 163595
If you can't find an XPath 2.0 parser that works in your environment, you could consider converting the query to XQueryX and running queries against it to check that it doesn't use any undesired features.
Upvotes: 1