XML Tutorials - Herong's Tutorial Examples - v5.25, by Herong Yang
dictionary_dtd.xml - XML DTD Document Type Example
This section provides XML DTD document type example, dictionary_dtd.xml, which uses ELEMENT, ATTLIST, and ENTITY DTD statements to define a document type called 'dictionary'.
Let's use the following XML file, dictionary_dtd.xml, to see how different DTD statements can be used:
<?xml version="1.0"?> <!-- dictionary_dtd.xml - Copyright (c) 2002 HerongYang.com. All Rights Reserved. --> <!DOCTYPE dictionary [ <!ELEMENT dictionary (note, word+)> <!ELEMENT note ANY> <!ELEMENT word (update?, name, definition+, usage*)> <!ELEMENT update EMPTY> <!ATTLIST update date CDATA #REQUIRED editor CDATA #IMPLIED > <!ELEMENT name (#PCDATA)> <!ATTLIST name is_acronym (true | false) "false"> <!ELEMENT definition (#PCDATA)> <!ELEMENT usage (#PCDATA | i)*> <!ELEMENT i (#PCDATA)> <!ENTITY herong "Herong Yang"> ]> <dictionary> <note>Copyright (c) 2002 by &herong;</note> <word> <name is_acronym="true">POP</name> <definition>Post Office Protocol</definition> <definition>Point Of Purchase</definition> </word> <word> <update date="2002-12-23"/> <name is_acronym="true">XML</name> <definition>eXtensible Markup Language</definition> </word> <word> <update date="2002-12-23" editor="Herong Yang"/> <name>markup</name> <definition>The amount added to the cost price to calculate the selling price</definition> </word> </dictionary>
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
DOCTYPE - Document Type Declaration Statement
ELEMENT - Element Declaration Statement
ATTLIST - Attribute List Declaration Statement
ENTITY - Entity Declaration Statement
►dictionary_dtd.xml - XML DTD Document Type Example
Validating an XML Document against the Specified DTD Document Type
XSD (XML Schema Definition) Introduction
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