DTD Guide (3) -dtd-Elements [Original]

xiaoxiao2021-03-06  39

Elements in a DTD, the XML element is declared by the element declaration of the DTD.

1. Declare an element using the following syntax to declare an XML element: or

2. Empty empty elements are declared by keyword EMPTY. The syntax format is:

Example: Used in XML documentation as

3. Elements that only character data use (#pcdata) to declare only character data elementary syntax format is: Example:

4. Elements containing any content contains any content to be declared by keyword ANY. The so-called arbitrary content refers to the possible data that can contain any combination. The grammatical format is: example:

5. Elements containing child elements If a element containing one or more sub-elements, it will define syntax formats by sub-element names containing parentheses: or

When the child element declares in the order in which it is appropriately decomposed, then they must appear in the same order in the document, and the child elements must be fully declared, of course they can have their own child elements.

Example: The following is a full statement of NOTE elements containing child elements

6. The same element only shows a statement of the statement: Example: The above example is that the meter element Message must appear once, and There is only one in the included Note element.

7. The same elements have at least once a statement of statement: Example: The fingertor element Message must be included There is a time or more in the Note element.

8. The same element does not appear or many declaration syntax formats are: Example: The * refers to the fingers Message It can not appear or multiple times in the included NOTE element.

9. The same elements do not appear or have a declaration grammatical format is: Example: Come in the fingers Message There is no or once in the included Note element.

10. "Or" Declaration Example: The above example refers to the Note element must contain a TO element, an from element, a header element, and a message Element or body element 11. A declaration example of mixing content:

转载请注明原文地址:https://www.9cbs.com/read-58439.html

New Post(0)