[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: How to express this in XPath: "when condition

Subject: Re: Re: How to express this in XPath: "when condition doaction" where condition cannot be evaluated until data arrives later
From: "Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Dec 2022 15:59:49 -0000
Re:  Re: How to express this in XPath: "when condition
Could you abuse streaming by opening a document that continues to supply a
value that indicates no police report until a police report arrives,
something like:


    <xsl:variable name="policeReport" as="document-node()">
      <xsl:iterate
select="doc('localhost://webservice/wait-for-police-report')/*/*">
        <xsl:on-completion>
          <xsl:document>
            <xsl:sequence select="."/>
          </xsl:document>
        </xsl:on-completion>
        <xsl:break select="./self::police-report|./self::timeout"/>
      </xsl:iterate>
    </xsl:variable>


Where the web service can have some defined timeout setting to end the
process.

Cheers,

E.


_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>

From: Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tuesday, December 20, 2022 at 8:49 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re:  Re: How to express this in XPath: "when condition doaction"
where condition cannot be evaluated until data arrives later
[External Email]


Am 12/20/2022 um 3:32 PM schrieb Roger L Costello costello@xxxxxxxxx:
> Hi Martin,
>
>
>
>> In what way does the program or the system know that
>> "the police report has arrived"? Is there e.g. a certain file
>> available in a certain location?
>
>
> Yes, when PoliceReport.xml arrives it is placed in the same folder as the
Car.xml file.
>
>
>

Well, Java can "watch" a directory for changes see e.g.
https://docs.oracle.com/javase/tutorial/essential/io/notification.html<https:
//docs.oracle.com/javase/tutorial/essential/io/notification.html>
so it is certainly possible to implement something in Java but I have no
idea how such a function would fit into Saxon's use of Java extension
functions to XSLT/XPath/XQuery; perhaps Michael Kay shows up later and
can tell you more.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.