The Rules Engine can generate a Document Type Definition (DTD) document for a table, based upon the repository information for that table. This way, you can validate the content of an XML file to be imported at an early stage against the DTD document.
However, a repository can contain more types of business rule than a DTD document. This limits the possible checks that can be generated into the DTD.
Here is an example of a DTD document generated by the Rules Engine:
<!ELEMENT employees ((employee | query)*)>
<!ELEMENT employee (insert | update | delete)?>
<!ATTLIST employee ID #CDATA #REQUIRED>
<!ATTLIST employee lastname #CDATA # #REQUIRED>
<!ATTLIST employee name #CDATA #IMPLIED>
<!ATTLIST employee insertion #CDATA ("den" | "van der" | "van") "">
<!ELEMENT insert (EMPTY)>
<!ELEMENT delete (EMPTY)>
<!ELEMENT update (EMPTY)>
<!ATTLIST update lastname #CDATA #IMPLIED>
<!ATTLIST update name #CDATA #IMPLIED>
<!ATTLIST update insertion #CDATA ("den" | "van der" | "van") "">
<!ELEMENT query (EMPTY)>
<!ATTLIST query lastname #CDATA #IMPLIED>
<!ATTLIST query name #CDATA #IMPLIED>
<!ATTLIST query insertion #CDATA #IMPLIED>
DTD
|
Repository Info
|
Remark
|
<!ELEMENT employees (employee*)>
|
For the table
|
Indicates that an XML file can contain the employees element, which has zero or more employee elements
|
<!ELEMENT employee (insert | update | delete)?>
|
For the table, depending on whether the table is insertable, updatable, deletable.
|
Indicates that an employee element contains zero or one insert, update or delete element.
|
<!ATTLIST employee lastname #CDATA #REQUIRED>
<!ATTLIST employee name CDATA #IMPLIED>
|
For the columns of the table
|
The employee element has a 'lastname' attribute with character data. This attribute is REQUIRED.
For the name attribute, the value is not required. (IMPLIED)
|
<!ATTLIST employee insertion #CDATA ("den" | "van der" | "van") "">
|
For the columns based on a domain with domain allowed values.
|
The employee element has an insertion attribute of type character.
The values are restricted to an enumerated set.
The values represented in XML correspond with the allowed values (the exact data in the database), not with the prompts for the allowed values.
|
<!ELEMENT insert (EMPTY)>
<!ELEMENT delete (EMPTY)>
<!ELEMENT update (EMPTY)>
|
For the table depending on whether table is insertable, updateable, deleteable
|
Specifies that there can be empty insert, update, and delete elements.
|
<!ATTLIST update lastname #CDATA #IMPLIED>
<!ATTLIST update name #CDATA #IMPLIED>
<!ATTLIST update insertion CDATA ("den" | "van der" | "van") "">
|
For the columns, depending on whether the column is updatable
|
If a column is not updateable, there will be no attribute for it in the update element.
Update attributes are non mandatory (IMPLIED).
No measures have been taken to prevent the update of a primary key value. This should be defined by making the column non-updatable.
The insertion attribute can only be updated to an allowed value.
|
<!ELEMENT query (EMPTY)>
<!ATTLIST query lastname #CDATA #IMPLIED>
<!ATTLIST query name #CDATA #IMPLIED>
<!ATTLIST query insertion #CDATA #IMPLIED>
|
|
Non query allowed columns not as attribute of query
|
|