XML Packets

Data Packet
Delta Packet
Error Packet

IAppServer

AS_GetRecods
AS_ApplyUpdates

Parsing XML

xmldom.js
XML Islands

XML Packets

XML Packets are passed between the MIDAS server and the InternetExpress application. There are three types of packets.

Data Packet

When an InternetExpress page is requested, the InternetExpress application calls the MIDAS server to get an XML representation of database data associated with a provider defined by MIDAS server. The web page is formulated by combining JavaScript, the XML data packet, and HTML forms.

TXMLBroker is the InternetExpress component responsible for making the request. It has a property for specifying the provider name. TXMLBroker also has a property used to limit the number of rows that will be retrieved.

Delta Packet

As the user edits data on an InternetExpress web page, the JavaScript library code tracks edits, inserts, and deletes. When the user chooses the Apply Updates button, a representation of these changes is posted to the InternetExpress application. For modified records, the delta packet includes the original data. If the original data does not match the record when reconciling, a reconcile error will occur.

TXMLBroker is the InternetExpress component responsible for reconciling the error packet with the MIDAS server. After a successfull reconcile, it will redirect to the page that posted the delta packet. TXMLBroker has a property that references a reconcile page producer. If a reconcile error occurs, the content of the reconcile page producer will be returned in the HTTP request.

Error Packet

When an InternetExpress application receives a request to apply updates, the MIDAS server is passed the XML data packet. If a reconcile error occurs, the MIDAS server returns an XML error packet to the caller. The InternetExpress application may build a reconcile page by combining the delta packet, error packet, JavaScript and HTML forms. TReconcilePageProducer is an implementation of a reconcile page.

IAppServer

IAppServer is the interface implemented by MIDAS servers and called by InternetExpress applications. The following IAppServer methods are called by TXMLBroker.

AS_GetRecords

Returns a data packet from a specified provider. To retrieve an XML data packet, pass the grXML flag.

AS_ApplyUpdates

Applies updates received from a client dataset using a specified provider. This function is passed a delta packet and returns an error packet and error count. It knows to return an XML error packet when the delta packet is XML.

Parsing XML

The XML embedded into InternetExpress pages must be parsed and stored in JavaScript data structures.

xmldom.js

IE 4 and Navigator do not have a built in XML parser. InternetExpress applications will detect these browsers and represent XML within the web page as a JavaScript string. The xmldom.js parser library will be included by the page.

XML Islands

IE 5.0 supports XML Islands. InternetExpress applications that detect IE 5.0 will generate XML islands. Xmldom.js will not be included. XML Islands result in significant performance improvements because the parser is faster and xmldom.js does not need to be downloaded.