XML Representation of Application Data With Processing Instructions

Previous Next

XML documents can contain additional processing instructions that state how the Rules Engine must process the XML data. These can be insert, delete, or update instructions. Here is the syntax description for the representation of application data with processing instructions in XML.

Syntax

<ObjectNamePlural>

    <TableName ColumnName="Value" [ColumnName="Value" ...]>

        <Insert|Delete|Update ColumnName="Value"/>

    </TableName>

...

</ObjectNamePlural>

 

 

An XML document can contain a mixture of row elements. A document can contain row elements without processing instructions and row elements with Insert, Delete, or Update instructions. Furthermore:

Spaces in the Object Name Plural are replaced by underscores.

Underscores are replaced by two underscores.

Table names and column names are always in uppercase.

No Processing Instruction

A row element without processing instructions indicates that the row element must be inserted. If a record with the same primary key already exists, the record must be updated.

Insert

The <Insert/> element indicates that the row element must be inserted.

If this record already exists or is refused by the Rules Engine, this results in an error message, and the import of the whole XML document fails.

Delete

The <Delete/> element indicates that the corresponding record must be deleted.

You have to include values for all primary key columns. If there is no corresponding record in the database, this results in an error message, and the import of the whole XML document fails.

Update

The <Update/> element indicates that the corresponding record must be updated.

You have to include values for all primary key columns. The column name attribute(s) contain the new values. By default, the original values will not be checked.

If there is no corresponding record in the database, this results in an error message, and the import of the whole XML document fails.

Example

<Persons>

    <PERSON ID="177" FAMILY_NAME="Haynes" FIRST_NAME="Deborah">

        <Insert/>

    </PERSON>

    <PERSON ID="203" FAMILY_NAME="Sutcliff" FIRST_NAME="Bill">

        <Delete/>

    </PERSON>

    <PERSON ID="112" FAMILY_NAME="Smith" FIRST_NAME="John">

        <Update FIRST_NAME="Johnny"/>

    </PERSON>

</Persons>

 

For examples of how to apply these instructions, see also: "The XML Import Method".