W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2002

How to properly define schemas

From: vze3y7w8 <boris.kortiak@verizon.net>
Date: Fri, 25 Oct 2002 06:21:15 -0400
To: <xmlschema-dev@w3.org>
Message-ID: <002c01c27c10$40ab6310$33fc5044@VAIO590G01>
I realize the subject is a bit nebulous, but bear with me.

 

I am coming from the world of a COBOL suit (20+ years) where I am used
to different name for the various things in the XML world.  I am trying
to create a mental map to fit (or perhaps cram) my COBOL concepts onto
XML.

 

The first mapping I am making is of FD (File Definitions) onto XSD.  As
I see it, the XSD is functionally equivalent to the FD in that it
defines the structure of the information contained in the XML document.
It enhances the FD concept in that it encapsulates some validation and
restriction rules that are not available in COBOL (In COBOL I am limited
to three basic data types: Numeric, Alphanumeric and Alphabetic).

 

Now my question comes in at converting a simple COBOL application to
using the XML tools.

 

Let us say I have a program that prints a purchase order (PO).  The PO
is actually made up of two files: header and detail.  The header file
contains information common to all of the detail lines for a PO, while
the detail file contains the variable details.

 

PO Header (in XML)

 

<PurchaseOrderHeader>

            <POH>

                        <PO_number>1</PO_number>

                        <PO_source>General Supply</PO_source>

                        <PO_duedate>2002-12-22</PO_duedate>

            </POH>

</PurchaseOrderHeader>

 

<PurchaseOrderDetails>

            <POD>

                        <PO_number>1</PO_number>

                        <PO_line>1</PO_line>

                        <PO_item>Widget</PO_item>

                        <PO_quantity>1</PO_quantity>

                        <PO_price>12.23</PO_price>

            </POD>

            <POD>

                        <PO_number>1</PO_number>

                        <PO_line>2</PO_line>

                        <PO_item>Gadget</PO_item>

                        <PO_quantity>12</PO_quantity>

                        <PO_price>11.34</PO_price>

            </POD>

</PurchaseOrderDetails>

 

Each of these, in COBOL, is a separate file.  These files are related to
each other by <PO_number/>.  Is there a best practice for defining the
XSD for each of these documents to make the relationship as easy to use
as possible, keeping in mind that something like XSL will be used to
transform the documents into a printable form?  How are one-to-one,
one-to-many, many-to-one and many-to-many relationships best dealt with?

--
boris@kortiak.com
 <http://www.boriskortiak.com/> http://www.boriskortiak.com/

 
Received on Friday, 25 October 2002 06:21:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT