Schema
for Object-Oriented XML (SOX)
In 1997, Veo Systems Inc.,
submitted a note to the W3C concerning a new schema defin-ition language
referred to as the Schema for
Object-Oriented XML (SOX). SOX was developed primarily to assist in the
development of large-scale, distributed electronic commerce applications. SOX
provides a better alternative to DTDs for the creation of efficient
software-development processes in distributed applications. SOX provides basic
data types that can be extended, inheritance for attributes and content models,
a powerful namespace mechanism, and documentation that can be embedded.
Compared with DTDs, the Schema for Object-Oriented XML decreases the complexity
of supporting interoperation among distributed applications by allowing various
SOX processors to crunch the schema file to produce varying outputs in an
automated fashion.
The SOX schema definition language is a
grammar-based language very similar to that of the XML Schema Definition
Language. Elements have “type” definitions and then are placed within parent
elements through a declaration statement. In the case of the SOX schema
definition language, the type definition comes in the form of the <elementtype> element. This element
contains the basic type definition for an element. By using the <model> element within the <elementtype> element, a schema author can
define the ele-ments’ definitions using element declarations, choices,
attribute declarations, and so on. A sample SOX schema for Listing 6.1 is shown
in Listing 6.6.
LISTING 6.6 PurchaseOrder.sox Contains
a Sample SOX Schema for
PurchaseOrder.xml
<schema name=”PurchaseOrder”>
<elementtype
name=”PurchaseOrder”> <model>
<attdef name=”Tax”
datatype=””/> <attdef name=”Total” datatype=””/>
<sequence>
<element
name=”ShippingInformation”/> <element name=”BillingInformation”/>
<element name=”Order”/>
</sequence>
</model>
</elementtype>
<elementtype
name=”ShippingInformation”> <model>
<sequence>
<element name=”Name”/>
<element name=”Address”/> <element name=”Method”/> <element
name=”DeliveryDate”/>
</sequence>
</model>
</elementtype>
<elementtype
name=”BillingInformation”> <model>
<sequence>
<element name=”Name”/>
<element name=”Address”/> <element name=”PaymentMethod”/>
<element name=”BillingDate”/>
</sequence>
</model>
</elementtype>
<elementtype
name=”Name”> <model>
<string/>
</model>
</elementtype>
<elementtype name=”Method”>
<model>
<string/>
</model>
</elementtype>
<elementtype
name=”DeliveryDate”> <model>
<string
datatype=”date”/> </model>
</elementtype>
<elementtype
name=”PaymentMethod”> <model>
<string/>
</model>
</elementtype>
<elementtype
name=”DeliveryDate”> <model>
<string
datatype=”date”/> </model>
</elementtype>
<elementtype
name=”Address”> <model>
<sequence>
<element
name=”Street”/> <element name=”City”/> <element name=”State”/>
<element name=”Zip”/>
</sequence>
</model>
</elementtype>
<elementtype
name=”Street”> <model>
<string/>
</model>
</elementtype>
<elementtype
name=”City”> <model>
<string/>
</model>
</elementtype>
<elementtype
name=”State”> <model>
<string/>
</model>
</elementtype>
<elementtype name=”Zip”> <model>
<string/>
</model>
</elementtype>
<elementtype
name=”Order”> <model>
<attdef name=”SubTotal”
datatype=”number”/> <attdef name=”ItemsSold” datatype=”int”/>
<sequence>
<element name=”Product”
occurs=”+”/> </sequence>
</model>
</elementtype>
<elementtype name=”Product”>
<model>
<empty/>
<attdef name=”Name”
datatype=”string”/> <attdef name=”Id” datatype=”string”/> <attdef
name=”Price” datatype = “number”/> <attdef name=”Quantity”
datatype=”number”/>
</model>
</elementtype>
</schema>
From Listing 6.6, you can
tell that the SOX schema definition language contains many similarities to the
XML Schema Definition Language, XDR schemas, DCD schemas, and DSD schemas. The <elementtype> element contains the type
definition for an element, which is then declared or referenced in other
element type definitions.
The major difference between
the W3C schema and the SOX schema is that in a SOX schema, if you redefine an
element’s type definition, any other element that makes a ref-erence to the
parent element type definition can also use the redefined or “subclassed” type
definition in its place.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.