Beruflich Dokumente
Kultur Dokumente
XML Document
Definition Description
What XML elements are and requirements for working with them in
Elements
XML documents.
Outlines the order and contents of the initial prolog or XML
Prolog
document header in an XML document.
Explains what the XML declaration is and its required placement if
XML Declaration
included in XML documents.
What processing instructions are in XML documents and their most
Processing Instructions frequent use, as a means of linking to an XML style sheet in
the prolog of an XML document.
What the DOCTYPE declaration is and how it is used to reference
DOCTYPE Declaration an external or internal Document Type Definition (DTD) for
XML documents that include it.
Explains how comments can be made in XML markup as a means of
XML Comments annotating and as a mechanism for including unparsed content
in the XML document.
Outlines the rules for use and inclusion of textual content (also
Textual Content
known as character data) in XML documents.
Describes XML character entities for escaping special or reserved
Character and Entity
characters that are used to delineate markup and node
References
boundaries within the XML document.
Describes the use of the XML-specific CDATA (character data)
CDATA Sections sections for fully escaping text contents (including formatting
or white space contents) in XML documents.
What XML attributes are and requirements for working with them in
Attributes
XML elements.
The rules and options for how white space can be handled when
White Space
parsing XML documents.
Elements
► Element Names
Element names are case-sensitive and
must start with a letter or underscore.
► Start Tags, End Tags, and Empty Tags
<elementName att1Name="att1Value"
att2Name="att2Value".../>
<giggle></giggle> or <giggle/>
Prolog
► The prolog refers to the information
that appears before the start tag of
the document or root element. It
includes information that applies to
the document as a whole, such as
character encoding, document
structure, and style sheets.
► <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href="show_book.xsl"?>
<!DOCTYPE catalog SYSTEM "catalog.dtd">
<!--catalog last updated 2000-11-01-->
► <?xml-stylesheet type="text/xsl"
href="show_book.xsl"?>
► <![CDATA[if (c<10)]]>Note
Content within CDATA sections must be within the
range of characters permitted for XML content;
control characters and compatibility characters
cannot be escaped this way. In addition, the
sequence ]]> cannot appear within a CDATA section
because this sequence signals the end of the
section. This means that CDATA sections cannot be
nested. The sequence also appears in some scripts.
Within scripts, it is usually possible to
substitute] ]> for ]]>.
Attributes
► Attributes allow we to add information
about an element using name-value
pairs. Attributes are often used to
define properties of elements that are
not considered the content of the
element, though in some cases (for
example, the HTML img element) the
content of the element is determined
by attribute values.
► <elementName
att1Name="att1Value"
att2Name="att2Value".../>
► <myElementquestion="They asked
"Why?"" />
► <myElementcontraction="isn't"
question='They asked "Why?"' />
White Space
► White Space and the XML Declaration
According to the current XML 1.0
standard, white space is not allowed
before the XML declaration.
Xml version=1.0
BOOK
BOOKNAMEXMLBOOKNAME
BOOK
► White Space in Element Content
XML parsers are required to report all white space that
appears in element content within a document. For this
reason, the following three documents are different to an
XML parse
► document
► data1data
► data2data
► data3data
► Document
► Documentdata1datadata2datadata3datadocument