[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How to express this in XPath: "when condition do actio
Hi Folks, I have an XSLT program that processes XML files in a folder. Some of the XML documents contain data about a car, like this: <Car> <Make>Toyota</Make> <Model>Avalon</Model> <LicensePlate>12345</LicensePlate> </Car> At some point the XSLT program reads in that XML document and begins processing it. The objective of processing is to output the license plate number if the car is stolen and "" (not stolen) otherwise. However, the document does not contain the necessary information to make that decision. The information to make the decision arrives some time later, in another document: <PoliceReport> <Car> <LicensePlate>12345</LicensePlate> <Status>Stolen<Status> </Car> </PoliceReport> So the desired processing behavior is this: Read the next XML document. If the XML document contains data about cars then Wait until the police report arrives .... .......... time elapses ........... the police report arrives: if it says the car is stolen then output "stolen" else output "" I want to express that! And, I want to express it, not in an XSLT program, but in a single XPath expression! The UNIX shell has an analogous functionality that I describe now. The "trap" command can be added into a shell program. The command has this form: trap command signal It has this meaning: During execution of the shell program, if 'signal' is received, then execute 'command'. Here's an example to illustrate how it may be used ('2' is the signal for the user pressing Ctrl+c; i.e., for the user terminating the program): trap "rm WORKDIR/file; exit" 2 That means: If the program is suddenly terminated (by the user pressing Ctrl+c), remove 'file' from the WORKDIR folder and then exit. I want that kind of functionality! In XPath! Is it possible to achieve that functionality using XPath? Or is this outside the realm of XPath capabilities? /Roger For my own notes: Potentially relevant information: Michael Kay Balisage paper: Asynchronous XSLT https://www.balisage.net/Proceedings/vol25/html/Kay01/BalisageVol25-Kay01.htm l Xalan-J Thread.sleep() function: all links I followed failed. Still available? Java Sleep() function: https://www.geeksforgeeks.org/thread-sleep-method-in-java-with-examples/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|