XML

From DataFlex Wiki
Revision as of 19:00, 7 April 2008 by Mikepeat (talk | contribs) (Added derivation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

XML: eXtensible Markup Language - is, like HTML, a sub-set of SGML - Standard Generalized Markup Language - itself a standardised form of [IBM's] [GML] - Generalized Markup Language.

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.


Using XML with Visual DataFlex

External Links