I l @ ve RuBoard |
An XML document is a text document that stores data. XML is similar to HTML because of the use of tags. However, XML differs from HTML in that HTML uses specific tags and is used for a specific purpose. XML, on the other hand, can use a completely custom tag set and can be used for any purpose where you need data. For instance, here is a simple XML document: <user> <name>Gary</name> <ID>47</ID> </user> This document defines a user. A user has two pieces of information stored: name and ID.
Figure 19.1 illustrates what nodes are. In it, you see a visual representation of the preceding XML example. You can see the five nodes: user, name, ID, the text node with "Gary," and the text node with "47." Figure 19.1. This diagram illustrates a simple XML file with three elements and two text nodes.
So why are XML documents so popular? The key is that they are both machine-readable and human-readable . Most other forms of databases are good for one or the other but not optimized for both. XML documents can be created by people with simple text editors. Creation can also be facilitated by XML editing programs. On the other hand, programmers can easily write programs that access XML data. Flash makes it easy to access the data in XML documents. The XML object can automatically parse an XML text document and then provide many functions and properties to access the information inside it.
|
I l @ ve RuBoard |