xsl-list
[Top] [All Lists]

Re: [xsl] Hints on http POST

2018-02-02 12:04:00
Wendell,

If you’re using Saxon, you could write a simple class to do the HTTP request 
and return the results. There’s a stack overflow thread on this: 
https://stackoverflow.com/questions/12761744/call-java-instance-methods-in-xslt

-Edward

From: Lizzi, Vincent vincent(_dot_)lizzi(_at_)taylorandfrancis(_dot_)com 
[mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com]
Sent: Friday, February 02, 2018 12:56 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Hints on http POST

Hi Wendell,

I wish I had the answer, as there are situations where being able to make 
non-trivial HTTP calls from within XSLT would be useful.

I can offer what has worked for me, which is essentially to use XQuery to run 
the XSLT and make the HTTP requests. Have a look at 
http://docs.basex.org/wiki/HTTP_Module and 
http://docs.basex.org/wiki/XSLT_Module for BaseX (other products have similar 
capability). It is fairly easy to write a query that pipelines the XSLT and 
HTTP request.

This is kind of a workaround rather than an exact answer to your question.

Vincent


From: Wendell Piez 
wapiez(_at_)wendellpiez(_dot_)com<mailto:wapiez(_at_)wendellpiez(_dot_)com> 
[mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com]
Sent: Friday, February 02, 2018 12:36 PM
To: 
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com<mailto:xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] Hints on http POST

XSL friends,

I have a need to procure a little bit of XML from a web service
running locally. To get it (once) from curl is easy:

curl -X POST -d "My string goes in here" localhost:8888/do/me

But I need to call it many many times, which I would naturally like to
do from inside my transformation.

Does anyone have any neat hints of how to do this under unextended (or
openly extended) XSLT 3.0?

I might also consider XProc except as I said this is very granular, a
natural for XSLT.

Many thanks,
Wendell


--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<-list/2643334> (by email<>)
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>