[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

The Division of Schema - A Practical Perspective (Re: Are we losingout b

  • From: Jay Zhang <jz@i...>
  • To: xml-dev@l...
  • Date: Tue, 30 Jan 2001 11:49:59 +0800

swift message structure
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"
XML format.
 
Structure
 
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
too.
 
The Datatypes
 
When it gets to datatypes, then schema definitions have to be used for the
granularity.
 
Rules
 
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:
 
<complextype name='F17URule'>
<any maxOccurs='*'/>
<body>
  <any maxOccurs='*'/>
  <element name='FIELD' tag='17U'>
    <complextype>
      <element name='FIELDLINE' fixed='Y'/>
    </complextype>
  </element>
  <any maxOccurs='*'/>
  <element name='BLOCK'>
    <complextype>
      <element name='FIELD' tag='15D'/>
      <any maxOccurs='*'/>
    </complextype>
  </element>
  <any maxOccurs='*'/>
</body>
</complextype>
 
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
standard compliance.
 
Can anyone show this rule in other forms? Please criticize my approach.
 
Semantics
 
The definition of semantics can start a philosophical discussion. However,
we are computer people, so we only need semantics useful for computer
processing.
 
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.
 
Jay Zhang
IntermicsTech, Inc.
 
 

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.