|
[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
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
|
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
|

Cart








