Understanding the different parts of XML dtd with a sample XML DTD You can easily understand the different parts of an XML DTD with a sample DTD document. Consider the following sample code in a DTD file. <!ELEMENT books ( book+ ) > The ELEMENT keyword indicates that an element is defined in the document. The word that follows the keyword is the name of the element. After the element the child nodes of that element are given in brackets. A plus sign by the side of the child node indicates that there could be one or more child nodes of that name. There are different notations to define different patterns like '?' and '*' after the name of the child node. The attributes of an element is defined using the keyword ATTLIST. If that particular attribute is always required you will be using the keyword #REQUIRED. The NMTOKEN in the above examples indicates the type of data that the attribute holds. An NMTOKEN can hold letters, point, digits, hyphen, underline and colon. The word #PCDATA indicates that the node can have text data that is parsed by the parser.
|
|
|||
|
||||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.