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

Loosely Typed Extensible Schemas

  • To: <xml-dev@l...>
  • Subject: Loosely Typed Extensible Schemas
  • From: "Brian Frank" <bfrank@t...>
  • Date: Mon, 2 May 2005 09:50:34 -0400
  • Thread-index: AcVPHen46tkTaxrtS7yIgvpjPI8mkA==
  • Thread-topic: Loosely Typed Extensible Schemas

loosely typed
Data Model
----------------------------------------
We have a abstract data model defined as a tree of objects. 
  - there are fixed number of primitive object types such as bool, int, or str
  - any object can contain any other objects
  - sometimes this tree structure is predefined
  - other times this tree structure is highly dynamic
 
Problem Statement
----------------------------------------
Ideally we would like to create a simple XML syntax for this data model where:
  - a small simple XML Schema can describe any tree of objects
  - larger XML Schemas which could be used to describe predefined trees of objects
    so that standard tools could be used to generate code stubs, etc
  - but either of the above the Schemas would provide a unified XML syntax
  - this XML will be used for REST and in SOAP/WSDL web services
 
Current Syntax
----------------------------------------
Our current schema produces XML which looks like this:
 
<obj name="WeatherReport">
   <real name="temperature" val="75.0" units="fahrenheit"/>
   <real name="humidity" val="53" units="percent"/>
   <bool name="sundown" val="true"/>
</obj>
 
This is a nice simple schema where the content is completely self defining.  However it doesn't play
real nice with XML Schema tools since if you want a "getTemperature()" method, "temperature"
really needs to be the element name. 
 
Ideal Syntax
----------------------------------------
That leads to us to syntax which looks something like this:
 
<obj name="WeatherReport">
   <temperature real="75.0" units="fahrenheit"/>
   <humidity real="53" units="percent"/>
   <sundown bool="true"/>
</obj>
 
But we have have great trouble arriving at a XML Schema design that would let us solve our problem
statement - we know ahead of time that WeatherReport has a temperature, but we don't know about
humidity and sundown (however we do know they all conform to a limited number of object types).
 
Is this possible?  What is the preferred design which plays well with XML Schema tools?
 
Brian
 

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.