schema output for critique

Andy Dent dent at
Sat Jun 5 23:58:55 BST 1999

The context of this is that we needed to finish a local contract in a 
hurry that involved reading and writing entire report definitions as 
well as data. The data had to come back in with a schema very close 
to the original (ie: data types such as date & int preserved) because 
the report-writer preview window also allows in-place editing of 

I therefore took a few minor shortcuts from the XML Schema working 
draft. My major concerns are:
1) nested scope of names eg: how to handle Value used within Order as 
an integer and within Employee as a string. (uggh, horrible example I 

2) masking for date types - the lexical suggestions don't seem to go 
far enough in allowing arbitrary letter separators.

Am I being silly in writing outpu datatypes for those we use which 
match the MS XML Data standard?

The following annotated sample gives an idea of what our output looks 
like, more examples at 
<> and I'm 
really interested in having them criticised.

<?xml version='1.0' standalone='yes'?>
<report ID='1'>

<!-- embedded schema
      The following is based largely on the XML Schema working group draft with our own datatypes
      (eg: ui2) defined below being compatible with Microsoft's data
      types in XML-Data, except format of date, time etc. defined in

      Our dbFields are <elementType>s nested within the <elementType> of
      the table, rather than the MS approach of declaring an <elementType>
      then using an IDRef in the <element> type attribute. This was partly
      to speedup development of our first release of schema parsing and
      partly because our database, like most others, allows field names
      to be reused within the local scope of a table and

       We use length attributes in the <datatype> to indicate string
       and base64 fixed length fields following the facets discussed in
       <datatype name='ui2'>
          <basetype name='dt:integer'/>
       <datatype name='i2'>
          <basetype name='dt:integer'/>
       <datatype name='ui4'>
          <basetype name='dt:integer'/>
       <datatype name='i4'>
          <basetype name='dt:integer'/>
       <datatype name='double'>
          <basetype name='dt:real'/>
       <datatype name='date'>
          <basetype name='dt:integer'/>
       <datatype name='dateTime'>
          <basetype name='dt:integer'/>
       <datatype name='time'>
          <basetype name='dt:integer'/><minInclusive>0</minInclusive>

       <elementType name='dbStudents'>
          <elementType name='Last_Name'>
             <datatypeRef name='string' length='25'/>
          <elementType name='First_Name'>
             <datatypeRef name='string' length='15'/>

Andy Dent BSc MACS AACM, Software Designer, A.D. Software, Western Australia
OOFILE - Database, Reports, Graphs, GUI for c++ on Mac, Unix & Windows
PP2MFC - PowerPlant->MFC portability

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list