Re: [xsl] How to express this in XPath: "when condition do action" where condition cannot be evaluated until data arrives later

Subject: Re: [xsl] How to express this in XPath: "when condition do action" where condition cannot be evaluated until data arrives later
From: "Michael Kay michaelkay90@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Dec 2022 17:16:42 -0000
Anything that keeps an OS process running waiting for input that might take
hours to arrive is going to be very bad news for performance. But yes, it can
be done.

With a parallel xsl:for-each in Saxon-EE you can arrange that holding up one
thread doesn't hold up all the others. But again, muiltithreading with long
waits for resources is generally a recipe for disaster.

Michael Kay
Saxonica

> On 20 Dec 2022, at 17:02, Andre Cusson akhu01@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> Graydon's approach seems the simplest.
> Alternatively, one could build a temporary tree/file of the info on cars not
yet reported as stolen, which gets updated/processed anytime a police report
comes in.
>
> Regards.
>
> Le mar. 20 dC)c. 2022, C  08 h 58, Graydon graydon@xxxxxxxxx
<mailto:graydon@xxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx
<mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> a C)crit :
> On Tue, Dec 20, 2022 at 01:46:22PM -0000, Roger L Costello
costello@xxxxxxxxx <mailto:costello@xxxxxxxxx> scripsit:
> > Let me relax my requirement that the "when condition do action"
functionality be implemented exclusively in XPath. Let's also allow XSLT.
Also, let's allow extension functions.
> >
> > Given those relaxed requirements, could the functionality that I seek be
implemented like this:
> >
> > Read the next XML document.
> > If the XML document contains data about cars then
> >     Call an XSLT function, f:waitForPoliceReport()
>
> Why not run the XSLT in response to the police report arriving?
>
> It's easy to consume the police report (presumably into a map) and then
> do the processing on the other data source.
>
> It looks like all the difficulty comes in because you're thinking of the
> conceptual "processing is delayed for the report" as something that has
> to be implemented literally.
>
> --
> Graydon Saunders  | graydonish@xxxxxxxxx <mailto:graydonish@xxxxxxxxx>
> CC&s oferC)ode, C0isses swC! mC&g.
> -- Deor  ("That passed, so may this.")
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3500899> (by
email <>)

Current Thread