XML is a general purpose markup language. It is generally used to store data in a standard way and is useful for exachanging data.
Here is an example of a simple XML file:
<customers> <customer id=1> <name>Data Access</name> <phone>1234-5678</phone> <website>http://www.dataaccess.com</website> </customer> <customer id=2> <name>Microsoft</name> <phone>1234-666</phone> <website>http://www.microsoft.com</website> </customer> <customer id=3> <name>Apple Computers</name> <phone>5555-4444</phone> <website>http://www.apple.com</website> </customer> </customers>
Attributes and Elements
XML files are made up of Attributes and Elements. Elements are tags withing the XML file that contain values. For example:
This is an Element called name which has a value of "Data Access". Elements are generally used to store the data being held in an XML file.
Attributes are values which are associated with an element. For example:
The attribute id belongs to the customer element and the value of the attribute is 2. Data stored in attributes are generally used to allow easy processing of the XML file. In this example having an id element allows you to easily find the customer element using a FindNode function.