X hits on this document

433 views

0 shares

1 downloads

0 comments

14 / 142

Chapter 2. A gentle introduction to XML markup

XML syntax

XML documents have syntactic and semantic structures. The syntax (think spelling and punctuation) is made up of a minimum of rules such as but not limited to:

  • 1.

    XML documents always have one and only one root element

  • 2.

    Element names are case-sensitive

  • 3.

    Elements are always closed

  • 4.

    Elements must be correctly nested

  • 5.

    Elements' attributes must always be quoted

  • 6.

    There are only five entities defined by default (<, >, &, ", and ')

  • 7.

    When necessary, namespaces must be employed to eliminate vocabulary clashes.

Each of these rules are described in more detail below.

XML documents always have one and only one root element

The structure of an XML document is a tree structure where there is one trunk and optionally many branches. The single trunk represents the root element of the XML document. Consider the following, overly simplified, HTML document, Figure 2.1:

6

Document info
Document views433
Page views439
Page last viewedThu Dec 08 02:49:11 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments