Project

Profile

Help

Feature #4464

closed

Calling 3rd-party API using ixsl:schedule-action/@http-request

Added by Mark Dunn over 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-02-25
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

The task I have is to update bibliographic references in an XML document with identifiers sourced from third party databases (e.g. CrossRef DOIs).

I thought Saxon-JS could be used to achieve this using just XSLT, by

  • building an HTTP request map from a bib reference
  • using ixsl:schedule-action/@http-request, parsing the response,
  • incorporating the result back into the bib reference.

But when I attempt this, I get an error in the browser "Cross-Origin Request Blocked". Because the HTTP request feature is only available in Saxon-JS, I have to run the code (attached) in a browser, which spots that the server running the code is trying to scrape data from another server, and blocks this action.

So my questions are:

  • Have I missed a parameter of some kind that would make this work?
  • Is it feasible to include ixsl:schedule-action and HTTP requests in Saxon-EE? (so I'm not tied to using a browser for this)
  • Or is the COR security issue a fundamental obstacle to making this work?

Files

reference-poller.zip (18.4 KB) reference-poller.zip Prototype using Saxon-JS to call a 3rd-party API Mark Dunn, 2020-02-25 09:57

Please register to edit this issue

Also available in: Atom PDF Tracking page