XML Tutorials - Herong's Tutorial Examples - v5.25, by Herong Yang
"element" - The Element Declaration Statement
This section describes syntax formats of the 'element' statement, which declares an XML element in the target namespace. If an element of the same name used in the target namespace, it must match the specified element type.
element is an XSD statement that declares an XML element in the target namespace.
Valid syntax formats for the "element" statement are:
<xsd:element name="target-element-name"/> <xsd:element name="target-element-name" type="type-name"/> <xsd:element name="target-element-name"> ... type declaration statement ... </xsd:element>
General rules about the "element" statement:
Examples of "element" statements:
<!-- Using an XML Schema built-in element type --> <xsd:element name="holiday" type="xsd:date"/> <!-- Using an inline element type --> <xsd:element name="numbers"> <xsd:simpleType> <xsd:list itemType="xsd:decimal"/> </xsd:simpleType> </xsd:element> <!-- Using an element type declared separately --> <xsd:element name="phone" type="phoneType"/> <xsd:simpleType name="phoneType"> <xsd:restriction base="xsd:string"> <xsd:pattern value="\d\d\d-\d\d\d\d"/> </xsd:restriction> </xsd:simpleType>
Table of Contents
Introduction of XML (eXtensible Markup Language)
DOM (Document Object Model) Programming Interface
SAX (Simple API for XML) Programming Interface
DTD (Document Type Definition) Introduction
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
"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
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
XSLT Elements as Programming Statements
Control and Generate XML Element in the Result
PHP Extensions for XML Manipulation
Processing XML with Python Scripts
XML Tools Plugin for Notepad++
XML Plugin Packages for Atom Editor