DTD building blocks
DTD - XML Building Module
The main elements of the building module are XML and HTML documents.
XML document building blocks
All XML documents (as well as HTML documents) are composed of the following simple building blocks:
Elements
Attributes
Entities
PCDATA
CDATA
##ElementsElements 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:The <message>some text</message>
attribute provides
extra information about the element.
Attributes are always placed in the opening tag of an element. Properties always appear inname/value pairs. The following "img" element holds additional information about the source file:
EntityEntity is a variable used to define ordinary text. An entity reference is a reference to an entity. Most students know this HTML entity reference: " ". The "no wrapping space" entity is used in HTML to insert an extra space in a document. Entities are expanded when the document is parsed by the XML parser.
Characters | |
---|---|
< | |
> | |
& | |
" | ##' |