XML

From DataFlex Wiki
Revision as of 03:30, 11 October 2007 by Hellboy1975 (talk | contribs) (New page: '''XML''' is a general purpose markup language. It is generally used to store data in a standard way and is useful for exachanging data. XML is commonly used as part of SOAP [[Web Se...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

XML is a general purpose markup language. It is generally used to store data in a standard way and is useful for exachanging data.

XML is commonly used as part of SOAP Web Services.

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:

 <name>Data Access</name>

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:

 <customer id=2>

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.

External Links