XML 1.0 came with a basic set of data types mostly useful for describing documents and their contents. XML Authority provides a larger set of data types that can be used to constrain element and attribute content to more traditional data categories, and allows you to extend these facilities using notations. Data types allow your schema to specify not only that an element or attribute should appear at a particular location in the document structure, but what kind of information is contained in that element or attribute - text, numbers, currency, times, dates, and more.
Data typing isn't necessary for all kinds of schemas, though it can be useful in a wide variety of situations. Schemas that describe purely textual information - memos, fiction, articles - can often do without them. Sometimes information that can be easily typed will also appear in these documents (like the date in a memo) will appear, and you can use a data type to highlight that information, though it isn't required. In other situations, like exchanges between databases and representations of internal software object structures, data types provide crucial information that can tell a program what to expect.
For schema designers, using XML Authority's tools to assign data types is fairly simple. (Application developers implementing data type checking have some more work to do, as most data typing isn't implemented in XML 1.0, and schema validation may require extra software components.) Elements may have a data type or they may contain text and or child elements; they may not have a data type and also contain other information. In the Element Types Window, check the 'Data' checkbox for the element and select a type from the Insert Qlicker that appears in the Content Model column. Attributes are even simpler, as their content models are simpler. The Type Qlicker in the Attribute Types Window gives you quick access to data types for attribute type declarations.
Choosing which data type to use for a particular element or attribute type is typically fairly clear, though you may need to negotiate with the developers implementing applications using the schema. If you use XML Authority's import tools to collect information on external data sources, data typing information may have been collected for you already.
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516