Project

Profile

Help

Saxon-JS browser support

Added by Jan-Paul van der Velden almost 4 years ago

Hi,

We at EBPI have a portal product which generates forms from an XBRL-taxonomy. An XBRL-taxonomy holds definitions for data definition, presentation and business rules. The business rules use XPath 2.0 expressions. We want to evaluate these expressions client side. Server side we use Saxon-EE to preprocess the business rules.

I have read the announcement about Saxon-JS. It looks very promising! I've also read about the browser support. Safari, Firefox and Chrome are supported and it's known not to work on IE.

I have a couple of questions:

  1. Is support for IE/Edge on the roadmap? If so when is it planned to be released?
  2. Our business case possibly uses a subset of the functionality that Saxon-JS provides. We want to evaluate expressions and get a true of false as a result. Could this use-case work in an IE setting?

I'm looking forward to hear from you!

Kind regards,

Jan-Paul van der Velden Product owner EBPI


Replies (9)

Please register to reply

RE: Saxon-JS browser support - Added by Jan-Paul van der Velden almost 4 years ago

Hi,

Some more detail might be useful to understand our use-case....

XBRL formulas use filters to filter the needed information from the XBRL-file. The result is presented to the Saxon engine using fact sources. Client-side we need to provide these fact sources.

HTH,

Jan-Paul.

RE: Saxon-JS browser support - Added by Debbie Lockett almost 4 years ago

Hi Jan-Paul,

Great to hear that you are interested in Saxon-JS!

Yes indeed, we have been working on support for IE/Edge (see https://saxonica.plan.io/issues/2913), and this will come with the next release. The next beta version of Saxon-JS should be out soon, hopefully within the next couple of weeks.

Unfortunately, it appears that the first beta release of Saxon-JS simply does not load in IE/Edge. So your use-case won't work yet I'm afraid.

RE: Saxon-JS browser support - Added by Michael Kay almost 4 years ago

We want to evaluate expressions and get a true of false as a result. Could this use-case work in an IE setting?

Ignoring the IE browser issues, at the moment we are doing XSLT and not standalone XPath. John Lumley has been doing some exploratory work on doing standalone XPath in the browser (that is, including a XPath parsing, static analysis, and type checking) which he reported on at Balisage a couple of months ago, but we haven't made any decisions about where to take that in product terms. If I understand your description correctly as if you should be able to construct a stylesheet server-side containing the XPath expressions you want to evaluate, e.g.




  

and then evaluate each expression by invoking the corresponding named template.

RE: Saxon-JS browser support - Added by Jan-Paul van der Velden almost 4 years ago

Hi,

It should very well be possible for us the put the XPath expression in a XSLT-template and invoke the template clientside.

Another thing we have to tackle is custom functions. The XPath expression can apply XBRL custom functions. See (https://specifications.xbrl.org/registries/functions-registry-1.0/index.html)

Am I right in thinking that the custom functions are executed clientside and that they should be available as Javascript functions? Are they pluggable as they are in Saxon-EE?

RE: Saxon-JS browser support - Added by Michael Kay almost 4 years ago

If the function implementations are in Javascript then yes, they will run client-side. At the moment I think you have to do this by writing xsl:function stubs:


  
  

That's assuming the function can't be implemented directly in XSLT, of course.

RE: Saxon-JS browser support - Added by Jan-Paul van der Velden almost 4 years ago

That sounds feasible.. Thanks for that.

Next question is about getting the data needed to Saxon-JS ... The portal we generate stores its data in a JSON structure. When producing XBRL from the JSON we do that server side, this is only done when the form has been completed.

Doing the business rule validation on the client we need portions of the JSON. We need to provide the fact sources needed for executing the XPath expression. Given that the fact sources should provide XML we are to produce XML from JSON using functions like fn:json-to-xml and fn:parse-JSON or custom functions to do the transformation.

Are there other alternatives to feed Saxon-JS the data?

RE: Saxon-JS browser support - Added by Jan-Paul van der Velden almost 4 years ago

Hi,

I've seen Debbie Lockett's recent comments in https://saxonica.plan.io/issues/2913#change-7684 about the browser support for Edge and IE.

Is de release date of the upcoming release already known?

Kind regards,

Jan-Paul van der Velden EBPI

RE: Saxon-JS browser support - Added by Debbie Lockett almost 4 years ago

Hi Jan-Paul,

So the answer is: today! Sorry for the delay, and thank you for your patience. I hope it all works in Edge and IE now...

Let us know how you get on!

Debbie

RE: Saxon-JS browser support - Added by Jan-Paul van der Velden almost 4 years ago

Hi Debbie,

Thank you! That's good news!

We'll start testing with this new release and will let you know how we get on with it.

Jan-Paul.

    (1-9/9)

    Please register to reply