Description of the DTD keyword in XML

Source: Internet
Author: User
Use the element keyword in a DTD document to declare an XML element. Syntax: <! element name use rules > Usage rules: (#PCDATA): Indicates that the body content of an element can only be normal text. (Parsed Character Data) Empty: Used to indicate that the body of the element is null. For example, <br/>any: used to indicate that the principal content of an element is any type. (child element): Indicates that the element contains child elements that define child elements and describe their relationship: if the child elements are separated by commas, the XML document must be written in the order in which they are declared. such as: <! Element FILE (Title,author,email) If the child element uses the "|" Separate, explain any choice. such as: <! ELEMENT FILE (title| author| EMAIL) with +, *,? To indicate the number of occurrences of an element if there is no +* behind the element?: Indicates must and can only occur once +: indicates at least one time, one or more times *: denotes dispensable, 0 times, one or more times?: Indicates can or can not, some words only once. 0 times or once such as: <! ELEMENT MYFILE (title*, AUTHOR?, EMAIL) * | COMMENT) >

Use the Attlist keyword in a DTD document to declare attributes for an element. Grammar:

<! Attlist element Name Property Name 1 property value type set Description Property Name 2 property value type set description ...

Property value type: CDATA: Indicates that the value of the property is a normal text string enumerated (DTD does not have this keyword): Represents an enumeration and can only be selected from the enumeration list, such as (chicken | beef | pork | fish) ID: Indicates that the value of the property cannot be repeated setting description # REQUIRED: Indicates that the property must appear #IMPLIED: Indicates that the property is optional #FIXED: Indicates that the value of the property is a fixed value. Syntax: #FIXED fixed Value Direct value: Indicates that the value of the property is the default value

  

Description of the DTD keyword in XML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.