9.2 XML Syntax
XML achieves its flexibility by allowing you to extend a base markup language (the XML specification itself) with tags of your own design. You create tags to structure the text within a document so that its underlying meaning is clearly presented. For example, to denote an item on an invoice, you could use an While XML and HTML documents look a lot alike, there are several important syntactical differences. HTML is fairly flexible. You can omit end tags from many of an HTML document's most important structures, such as list items, and most browsers will happily display the document as best they can. XML documents, however, must meet a more rigid set of requirements:
A document that follows all these rules is called well-formed , which means that it is syntactically correct. Even more so than with HTML, XML requires a precise syntax to make sure the documents follow a predictable structure. Fortunately, there are several commercially available tools that help you create well-formed XML documents. Figure 9.1 shows Vervet Logic's XML Pro ( http://www.vervet.com ). Figure 9.1: XML Pro by Vervet LogicIn the next section we'll look at how you can define strict rules the tags in your documents must follow. Copyright (c) 2000 O'Reilly & Associates. All rights reserved. |
|