What Is XML?

I l @ ve RuBoard

XML is a language for creating metadata. Metadata is data that describes itself. To explain this further, let's look at a sample XML document:

 <?xml version="1.0" encoding="UTF-8"?>  <PEOPLE>       <PERSON>            <NAME>Andrew</NAME>       </PERSON>  </PEOPLE> 

Don't worry if you have never encountered XML. I will explain how XML is made up later in this chapter. In this example, the data is a name: Andrew. Using XML, you can turn Andrew into metadata by describing it as a NAME :

 <NAME>Andrew</NAME> 

Each NAME belongs to a PERSON , which in turn belongs to PEOPLE . You can have multiple items of data that are all names , and you can describe them as such using the same method:

 <?xml version="1.0" encoding="UTF-8"?>  <PEOPLE>       <PERSON>            <NAME>Andrew</NAME>       </PERSON>       <PERSON>            <NAME>Emma</NAME>       </PERSON>       <PERSON>            <NAME>Terry</NAME>       </PERSON>       <PERSON>            <NAME>Mary</NAME>       </PERSON>       <PERSON>            <NAME>Thomas</NAME>       </PEOPLE>  </PERSON> 

The elements that make up XML documents are called nodes . The sample XML document has the following nodes:

 <NAME></NAME>  <PERSON></PERSON>  <PEOPLE></PEOPLE> 

The most interesting thing to note about this example is that I made it up. XML is not really a language as such but a method that lets you create your own markup languages to then create metadata. You might have seen markup languages before; HTML is perhaps the most common markup language. (A version of HTML developed in XML is called XHTML.)

I l @ ve RuBoard


PHP Programming for Windows
PHP Programming for Windows (Landmark (New Riders))
ISBN: 0735711690
EAN: 2147483647
Year: 2002
Pages: 99

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net