Project

Profile

Help

Maintenance: Planio will be observing a scheduled maintenance window this Sunday, November 10, 2024 from 20:00 UTC until 21:00 UTC to perform important network maintenance in our primary data center. Your Planio account will be unavailable for a few minutes during this maintenance window.

async HTTP Requests ?

Added by Jim Fuller about 11 years ago

I've read some of the previous emails (on other lists elsewhere) about performing js based http requests ... a few questions (and prob RFE).

I fully appreciate the ability to reach into the DOM and js libs,

but I do want to keep idioms simple and wondering if there are any plans in providing any saxon extensions for performing HTTP requests ?

Also he docs don't state but I thought I would ask if there are any existing extension funcs that saxon XSLT supports that have found their way into saxon-ce ?

thx in advance, Jim Fuller


Replies (3)

Please register to reply

RE: async HTTP Requests ? - Added by Michael Kay about 11 years ago

I think there are two parts to this: (a) making the request asynchronous, and (b) providing more control than you get via the doc() function.

Do you need more from GET requests than doc() gives you (other than asynchroneity)?

Or are you mainly concerned with doing other kinds of request, e.g. PUT?

I don't think it would be too difficult to do something like



which does an asynchronous request to fetch an XML document from a given URI and then fires a transformation to process it in the given mode as soon as it arrives.

But I don't know how much of the requirement that would meet.

We need to be very conservative about adding extensions to CE, since we don't want to bloat the code size: we should aim to get it down further rather than increasing it.

Michael Kay Saxonica

RE: async HTTP Requests ? - Added by Jim Fuller about 11 years ago

fn:doc being sync is a bit of an issue, but I am more concerned about scenario b).

Wanting to perform async HTTP GET/POST/PUT/DELETE from saxon-ce 'out of the box' is #lazyweb on my part.

I guess the answer could be an external (EXPATH ?) function library instead of a built in but I don't have the time to write yet another func library, but that being said I will end up writing something in javascript to get the basic REST functionality I need.

J

RE: async HTTP Requests ? - Added by Michael Kay about 11 years ago

Let us know how you get on and we'll see what we can do to productize it.

(One of the reasons I've never incorporated an HTTP library in the main Saxon product is the difficulty of doing automated tests. We need to tackle that.)

    (1-3/3)

    Please register to reply