schema output for critique
Andy Dent
dent at oofile.com.au
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
content.
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
know)
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
<ftp://ftp.highway1.com.au/pub/adsoftware/xml/reportOutput/> 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
http://www.w3.org/TR/xmlschema-1/ 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
http://msdn.microsoft.com/xml/schema/reference/datatypes.asp
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
http://www.w3.org/TR/xmlschema-2/
-->
<schema
xmlns:dt='http://www.w3.org/xmlschemas/datatypes'>
<datatype name='ui2'>
<basetype name='dt:integer'/>
<minInclusive>0</minInclusive>
<maxInclusive>65,535</maxInclusive>
</datatype>
<datatype name='i2'>
<basetype name='dt:integer'/>
<minInclusive>-32,768</minInclusive>
<maxInclusive>32,767</maxInclusive>
</datatype>
<datatype name='ui4'>
<basetype name='dt:integer'/>
<minInclusive>0</minInclusive>
<maxInclusive>4,294,967,295</maxInclusive>
</datatype>
<datatype name='i4'>
<basetype name='dt:integer'/>
<minInclusive>-2,147,483,648</minInclusive>
<maxInclusive>2,147,483,647</maxInclusive>
</datatype>
<datatype name='double'>
<basetype name='dt:real'/>
<minInclusive>1.7E-308</minInclusive>
<maxInclusive>1.7E308</maxInclusive>
</datatype>
<datatype name='date'>
<basetype name='dt:integer'/>
<minInclusive>0</minInclusive>
<maxInclusive>4,294,967,295</maxInclusive>
</datatype>
<datatype name='dateTime'>
<basetype name='dt:integer'/>
<minInclusive>0</minInclusive>
<maxInclusive>4,294,967,295</maxInclusive>
</datatype>
<datatype name='time'>
<basetype name='dt:integer'/><minInclusive>0</minInclusive>
<maxInclusive>65,535</maxInclusive>
</datatype>
<elementType name='dbStudents'>
<elementType name='Last_Name'>
<datatypeRef name='string' length='25'/>
</elementType>
<elementType name='First_Name'>
<datatypeRef name='string' length='15'/>
</elementType>
</elementType>
</schema>
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
http://www.oofile.com.au/
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list