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

Re: Data binding as type definition


definition data binding
6/11/02 7:46:56 AM, Amelia A Lewis <amyzing@t...> wrote:


>So, is it better to define a type in XML as something that can be
>validated, or as something that maps to type A in language Z, type B in
>language Y, type A again in language X, and type L in language O?
>
>I submit that attempting to define XML types by mapping to a set of
>native types in privileged languages is neither robust nor extensible. 
>It seems to me that, on the model of validation of structured types, it
>is possible to define unstructured (simple) types by how they are
>validated, and that that definition is interoperable.

Pretty much agreed.  I think that validation (specifying constraints on what an instance can 
contain) and data binding (determining how to represent the textually-represented data in an 
instance as bits within an application) are two separate tasks, and it doesn't make sense to try to 
use the same language to do both.  It especially doesn't make sense for the spec for the schema 
language to contain a set of hard-wired "internal bits" types.

I'd rather see a separate "bind mapping" language that would allow one to give hints (or even 
orders) for how to map various pieces of character-level data into internal structures in various 
languages.  I'm thinking in terms of a list of XPath expressions, each associated with a list of 
language/application => type name pairs, something like:

<bindings>
  <data match="//product/ID/@SKU">
    <language name="Perl" binding="scalar"/>
    <language name="C" binding="unsigned long"/>
  </data>
</bindings>

A data binding application would use the bind mapping language to determine storage formats, and 
the schema language to determine structural nesting and actual validation constraints on simple 
types (that is, constraints imposed by the real-world problem domain, not by the number of bits 
allocated for storage).  Applications that don't involve data binding wouldn't need to use a bind 
mapping processor.
 



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.