YouTip LogoYouTip

Dtd Building

# DTD - XML Building Modules * * * The main building blocks of XML and HTML documents are element tags. * * * ## XML Document Building Blocks All XML documents (and HTML documents) consist of the following simple building blocks: * Elements * Attributes * Entities * PCDATA * CDATA * * * ## Elements Elements are the **main building blocks** of XML and HTML documents. Examples of HTML elements are "body" and "table". Examples of XML elements are "note" and "message". Elements can contain text, other elements, or be empty. Examples of empty HTML elements are "hr", "br", and "img". Example: some text some text * * * Attributes provide **additional information about an element**. Attributes are always placed within the start tag of an element. Attributes always appear in pairs as **name/value**. The following "img" element has additional information about the source file: The name of the element is "img". The name of the attribute is "src". The value of the attribute is "computer.gif". Since the element itself is empty, it is closed with a " /". * * * ## Entities Entities are used to define variables for common text. Entity references are references to entities. Most students are familiar with this HTML entity reference: " ". This "non-breaking space" entity is used in HTML to insert an extra space in a document. When a document is parsed by an XML parser, entities are expanded. | Entity Reference | Character | | --- | --- | | < | | | & | & | | " | " | | ' | ' | * * * ## PCDATA PCDATA stands for parsed character data. Character data can be thought of as the text between the opening and closing tags of an XML element. **PCDATA is text that is parsed by the parser. These texts will be checked by the parser for entities and tags.** Tags in the text are treated as tags, and entities are expanded. However, parsed character data should not contain any & , characters; they should be replaced with & , < , and > entities respectively. * * * ## CDATA CDATA stands for character data. **CDATA is text that is not parsed by the parser.** Tags in this text are not treated as tags, and entities within them are not expanded. AI is thinking... [](#)(#) (#)[](#) [Byte Ark Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., official supply is stable and reliable. Β₯9.9/ month, immediately open](https://maas.xfyun.cn/modelSquare?ch=maas_lm_l2E) ### Click here to share notes
← Dtd ElementsAppml Case Products β†’