Page 11 of 28PREVNEXT

XML: What's it all about?

The parts of an XML data file

More parts of an XML data file.
Callout 1 Declarations
Callout 2 Root element
Callout 3 Attribute
Callout 4 Tags and data

In addition to data and tags, XML data files contain declarations, root elements, and attributes. The names may sound mysterious, but after some brief definitions, you'll see that these are all simple and logical.

XML declarations are statements in the data file that identify it and other files it works with. In this illustration, the first declaration states that the file is an XML file. (If that's not stated, programs don't know how to work with it.) The second declaration names a file that governs data structure for this file and other files of its sort. The third declaration names a file that is used to control the appearance of the data, and that allows an XML system to reorganize the data.

Root element means one tag that contains all the other tags, and all the data in each particular record. XML files require root tags. For this vet's data files, the root tag is the individual animal client.

Attributes store information about the tags and the data in them. The types of information in attributes are defined by the XML for each kind of tag. In this example, every animal client must have a patient number as an attribute of the root element.

Tags and data are, of course, the principal components of the file. You can also think of tags and data as child elements contained by the <CAT> … </CAT> root element.
Page 11 of 28PREVNEXT