KickStart Tutorial XML by Jan Kampherbeek - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Elements and sub elements

Elements and children

With XML tags you define the type of data. But often data is more complex. It can consist of several parts.
To describe the element car you can define the tags <car>mercedes</car>. This model might look like this:

<car>
<brand>volvo</brand>
<type>v40</type>
<color>green</color>
</car>

Besides the element car three other elements are used: brand, type and color. Brand, type and color are sub-elements of the element car. In the XML-code the tags of the sub-elements are enclosed within the tags of the element car. Sub-elements are also called children