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

Re: Re: How to express this in XPath: "whenconditiond

Subject: Re: Re: How to express this in XPath: "whenconditiondoaction" where condition cannot be evaluated until data arriveslater
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Dec 2022 18:08:53 -0000
Re:  Re: How to express this in XPath:  "whenconditiond
Hi Folks,

A colleague gave me this (very cool) approach.

A Car.xml document is input and placed inside a <Document> element:

<Document>
    <Car>
        <Make>Toyota</Make>
        <Model>Avalon</Model>
        <LicensePlate>12345</LicensePlate>
    </Car>
    <State></State>
</Document>

The <State> element will be used to store Car inputs. Initially it is empty.

If there is no PoliceReport.xml, then output Document, with the Car moved into
the <State> element.

Read in the next Car.xml, along with Document.xml and put the next Car into
<Document>

<Document>
    <Car>
        <Make>Honda</Make>
        <Model>Accord</Model>
        <License>abcde</License>
    </Car>
    <State>
        <Car>
            <Make>Toyota</Make>
            <Model>Avalon</Model>
            <LicensePlate>12345</LicensePlate>
        </Car>
    </State>
</Document>

Notice the first car is now inside <State> to reflect the state of the system
(namely, previously we processed data for the Toyota Avalon).

Repeat this process until a PoliceReport.xml document arrives. When it
arrives, query <State> for a matching <Car> element and output "Stolen" or ""
for the car.

This approach gets you out of dealing with time. Time goes away as part of the
definition of the system.

Wicked cool!

/Roger

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.