ProDataSet to XML round-trip example
- Last Updated: October 17, 2024
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
One of the most important use cases for the features described in this content is that of the XML round-trip. XML can be a persistent storage mechanism between OpenEdge sessions. For example, a mobile computing model could use XML as a persistent data store. Suppose a sales representative could work off-line from the server with a local copy of selected records, limited to his accounts, stored as XML. The mobile application could read the XML and work locally. The changes made off-line by the sales representative on the records would be stored locally as an updated XML file, storing before-image data as well. When the sales representative reconnects to the system, the XML would be sent back to the application server to synchronize with enterprise application. The application code could decide whether to apply the remote changes or overwrite with server changes. The before-image data could be used to compare changes that might have been made while the sales representative was working remotely.
All you need to do is create an XML write procedure to store
your data and an XML read procedure to retrieve it. Of course, you
must ensure that the min-xmlschema option is
set to FALSE. That is, you want the AVM to write
the ABL XML Schema extensions so that the ABL definitions are fully
restored when the file is read back in.
The following include file sets up a pair of temp-tables and a ProDataSet for the two code samples to use:
|
The first code sample performs an XML write and informs you if it has been successful:
|
The second code sample performs an XML read and informs you if it has been successful, as shown:
|