Simple Element Types with Built-in Data Types

This section describes simple element types using XML Schema built-in data types, which are organized in 5 groups: numeric, date and time, string, binary and Boolean.

Simple XML Element Type: An XML element that has no child elements and no attributes. Simple XML elements can be defined in XSD with the following statement:

<xsd:element name="element_name" type="xsd:type_name"/>

where "element_name" is the name of the XML element, and "type_name" is one of the data type names built-in (predefined) in XSD.

XSD built-in data types are divided into 5 groups:

Numeric data types: All commonly used integer and real number types:

Date and time data types: Date and time related data types. Constants of date and time types are written in the format defined by ISO 8601. For example: "2002-12-23T14:19:00.000-05:00" represents an instance of time at 14:19:00.000 on December 23, 2003, with 5:00 time zone adjustment.

String data types: String related data types.

Binary data types:

Boolean data type:

One example of using built-in XSD data types is in our hello_xsd.xml:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <xsd:element name="p" type="xsd:string"/>
</xsd:schema>

where element "p" is defined to be a simple element type allowing child text node containing data of "xsd:string" type.

Last update: 2014.

Table of Contents

 About This Book

 Introduction of XML (eXtensible Markup Language)

 XML File Syntax

 XML File Browsers

 DOM (Document Object Model) Programming Interface

 SAX (Simple API for XML) Programming Interface

 DTD (Document Type Definition) Introduction

 Syntaxes of DTD Statements

 Validating an XML Document against the Specified DTD Document Type

 XSD (XML Schema Definition) Introduction

Syntaxes of XSD Statements

 "schema" - The Schema Declaration Statement

 "element" - The Element Declaration Statement

Simple Element Types with Built-in Data Types

 Simple Element Types with Extended Data Types

 Complex Element Types

 Simple Content Element Types

 Empty Element Types

 Anonymous or Inline Data Types

 dictionary.xsd - A Sample XSD XML Schema File

 Validating XML Documents Against Specified XML Schemas

 XSL (Extensible Stylesheet Language) Introduction

 XSLT (XSL Transformations) Introduction

 Java Implementation of XSLT

 XPath (XML Path) Language

 XSLT Elements as Programming Statements

 Control and Generate XML Element in the Result

 XML Notepad - XML Editor

 XML Tools Plugin for Notepad++

 XML 1.1 Changes and Parsing Examples

 Outdated Tutorials

 References

 PDF Printing Version