Eric van der Vlist wrote:
> Looks like we are going towards 4 different types of XML "schema"
> languages to define:
> - The structure
> - The datatypes
> - The rules
> - The semantic.
You made an excellent point.
Let me use a project I am working on to illustrate this division.
Although SWIFT has a plan to adopt XML, the legacy SWIFT format is expected
to coexist with whatever new standard under construction. We are undertaking
a project that maps traditional SWIFT standard directly to some "interim"
DTD is sufficient to express the structure:
<!ELEMENT message (header1, header2, header3?, body, trailer?)>
<!ELEMENT body (field*)>
<!ELEMENT field (fieldline*|subfield*)>
<!ATTLIST field tag NMTOKEN #REQUIRED>
XSL transformation rules are based on processing on these structural elements
When it gets to datatypes, then schema definitions have to be used for the
In plain English, a SWIFT message rule is expressed as something like:
"If the value of field 17U is 'Y', then field 15D must exist."
I write it in XML Schema form:
<element name='FIELD' tag='17U'>
<element name='FIELDLINE' fixed='Y'/>
<element name='FIELD' tag='15D'/>
We relax the schema to allow multiple types to apply the rules. This way, we
can limit ourselves to only XML Schema standard. A preprocessor can process this
into an enormous standard schema by using union. I am a compiler guy, so I
prefer writing my rules in grammar approach and apply preprocessing for
Can anyone show this rule in other forms? Please criticize my approach.
The definition of semantics can start a philosophical discussion. However,
we are computer people, so we only need semantics useful for computer
Definition: Semantics. All the basic relationships involving an object, that
are sufficient to deduct all the relationships required for computing tasks
about this object.
In our specific case, a SWIFT message is used to relate to other SWIFT
messages of the same or different types. A collection of the match, amendment,
cancellation, and field correlation rules among SWIFT messages make up
the semantics of the SWIFT messages.