XML in one slide



  • Legal XML documents are called well-formed
  • A well-formed document describes a logical tree
  • If a well-formed document conforms to an optional set of constraints (a DTD), it is also valid

A well-formed XML document:

<greeting type="friendly">Hello, world!</greeting>

A valid XML document:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE greeting [
  <!ELEMENT greeting (#PCDATA)>
  <!ATTLIST greeting type (friendly | unfriendly)
                                      "friendly" >
<greeting>Hello, world!</greeting>

[Sun logo]