XML Documents
Home ] Up ] Why XML? ] Domain-Specific MLs ] XML for XML ] XML Parsing ] [ XML Documents ] XML Namespaces ] DTD and XML Schema ] Using Java with XML ]

 

The Document Prolog
XML Elements
The Root Element
XML Attributes
Attribute vs. Element?
Whitespace and Comments
XML Character Entities
CDATA Sections
Processing Instructions
Well-Formed Documents

 

Now, let's learn how to create an XML document.

Here's a simple example of an XML document:

<?xml version="1.0" encoding="utf-8"?>
<memo>
  <to>Bill Gates</to>
  <from>Royston G. Farnsworth</from>
  <subj>Microsoft Products</subj>
  <greeting>Dear Bill</greeting>
  <content>
    <para>
    We would like to suggest that you reduce the price 
    of your products. They have become far too expensive.
    </para>
    <para>Please give us a break!</para>
  </content>
</memo>

As you can plainly see, this XML represents a simple memo, with tags for memo, to, from, subj, greeting, content, and para.

You can see how your browser renders this XML by clicking here.

 
The page was last updated February 19, 2008