The best DTD element Tutorial In 2024, In this tutorial you can learn Declare an element,Empty elements,Only PCDATA element,Elements with no content,Element has children (sequence),Statement elements appear only once,Declaration element appears at least once,Zero or more element declarations appear,Declaring zero or one element,Statement "Non ... / ... both" types of content,Content declaration hybrid,
In a DTD, element by element declaration to be declared.
In a DTD, XML element by element declaration to be declared. Element declaration with the following syntax:
Empty elements declared by category keyword EMPTY:
Only PCDATA elements inside parentheses #PCDATA declared:
Statement by category keyword ANY element can contain any combination of parsable data:
Elements with one or more children elements inside parentheses child element names declared:
When the sub-elements separated by commas according to the sequence of statements, these sub-elements must appear in the same order in the document. In a full declaration, the children must also be declared, but also child elements can have child elements. "Note" element is the complete statement:
The above example declares: message the child elements must appear once, and must appear only once in the "note" element.
The example above the plus sign (+) declares: message the child elements must appear at least once in the "note" element.
The above examples asterisk (*) declares: child element message can appear in the "note" element zero or more times.
The above example declares question mark (?): The child element message can appear in the "note" element zero or one time.
The above example declares: "note" element must contain a "to" element, "from" element, "header" element, as well as non "message" element only "body" element.
The above example declares: "note" element can contain zero or more times PCDATA, "to", "from", "header" or "message".