6.5. Modeling Datatypes

Traditional data sources tend to be strongly typed. While an XML document, by definition, represents information as characters, retaining knowledge about the underlying datatype is essential. The metadata property dtype (as outlined above) will be used to capture datatype information. What set of datatype values should we use? While a comprehensive list of datatypes is an elusive (if not illusory) goal, a useful set has been compiled from the various schema submissions to the W3C. We'll adopt the convention of using these datatype names.

string
number
dateTime

boolean
float
date

uri
int
time

A related problem arises around the issue of storage size. For example, how many bytes are needed to store a value of type "int" ...

Get Enterprise Application Integration With XML and Java™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.