XML

Unit 4: New Web Technologies: XML, XHTML, CSS

Lesson 1: XML

Reference: What is XML? by Norm Walsh

What is XML?

Why XML?

Why not HTML?

Example

Components of XML

Elements

Attributes

Entity References

Comments

Processing Instructions

Document Type Declaration (DTD)

Well Formed Documents

Example

An example of a well formed XML Document:

      <?xml version="1.0"?>
      <CDs>
        <CD>
          <artist>Bob Dylan</artist>
          <title>Blonde On Blonde</title>
          <release_date>1966</release_date>
        </CD>
        <CD>
          <artist>The Doors</artist>
          <title>L.A. Woman</title>
          <release_date>1971</release_date>
        </CD>
      </CDs>

Example

An example of an XML Document that is not well formed:

      <?xml version="1.0"?>
      <cds>
        <CD>
          <artist>Bob Dylan
          <title>Blonde On Blonde</artist></title>
          <release_date>1966</release_date>
        </cd>
        <cd>
          <artist>The Doors</artist>
          <title>L.A. Woman</title>
          <release_date>1971</release_date>
        </CD>
      </CDs>

Valid Documents