XML For Dummies by Lucinda Dykes & Ed Tittel

XML For Dummies by Lucinda Dykes & Ed Tittel

Author:Lucinda Dykes & Ed Tittel
Language: eng
Format: epub
Publisher: Wiley


Step 5: Using Datatype Declarations to Define What’s What

A datatype declaration is a statement added to an element or attribute in a schema that lets document creators (or validating parsers) know exactly what kind of data you’re actually working with when you declare an element or attribute. Using XML Schema, you can get even more explicit than a run-of-the-mill built-in datatype: Using any of the 44 XML Schema datatypes, you can derive your own datatypes, adding further qualifications in your quest to make the datatype more specific to the demands of your work.

As you build your custom schema, you need to think carefully about the type of data each element and attribute will hold, and take advantage of datatype declarations to pass the specifics to document builders and processing applications. After you’ve created your initial set of elements and attributes, go back and add datatype declarations to them.

As we mention in Chapter 9, XML Schema offers 44 built-in datatypes — from strings to integers, to date and time stamps, and beyond — for you to use. XML Schema also has the unique feature of supporting reusable user-derived datatypes — in other words, you can derive your own datatypes from the built-in datatypes and reuse these datatypes throughout your schema document.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.