Project

Profile

Help

XPath 3.0 support in the browser

Added by Nick Van den Bleeken over 3 years ago

Hi,

XSLT 3.0 support in the browser through Saxon-JS is very neat. But for an application that I'm working on, we are considering to use XPath 3.0 as a query language to express data bindings (data fields, conditions, repeats, ...).

XPath is a natural fit for us, because we already use XPath, XSLT and XQuery throughout our solution. But this is the first time that we need to calculate XPath expressions client side in the browser, and can't use Saxon EE' implementation in Java.

Are there any plans in releasing a Javascript API to execute XPath expressions in the browser outside an XSLT? Please let us know if it is helpful to elaborate more about our use-case, or if any other information is needed to answer my information request.

Regards,

Nick Van den Bleeken


Replies (5)

Please register to reply

RE: XPath 3.0 support in the browser - Added by Michael Kay over 3 years ago

Please come to XML Prague

http://www.xmlprague.cz/day2-2017/

where you may learn something to your advantage...

RE: XPath 3.0 support in the browser - Added by Nick Van den Bleeken over 3 years ago

Hi Michael,

Thank you for the fast reply, the talk looks interesting. I wasn't planning to come to XML Prague, but this might change things. Do you know if your talk is going to be on Friday or Saturday?

Regards,

Nick

RE: XPath 3.0 support in the browser - Added by Michael Kay over 3 years ago

I don't think a detailed schedule for Fri/Sat sessions is available yet.

RE: XPath 3.0 support in the browser - Added by Johan Walters over 3 years ago

We have a similar use case, although all xpath expressions are statically known. We create a trivial stylesheet template around each expression, and use Saxon EE to generate the SEF (once, 'offline'). Each invocation of an xpath expression becomes a template call. In order to pass runtime values into the expression, we create a source document for each template call. For each variable in the expression, the template will lookup the value in the source document and assign it to a xsl variable.

RE: XPath 3.0 support in the browser - Added by Michael Kay over 3 years ago

The Saxon-JS 1.0 release now supports dynamic XPath evaluation, either from Javascript or from XSLT using xsl:evaluate. Please give it a try.

    (1-5/5)

    Please register to reply