Home > Articles > Web Services > XML

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Start Tag

XML data is a serial stream. The start tag informs the receiving software that all the incoming data will belong to this element until the matching end tag is encountered. Very often, more start tags are encountered before the end tag. Each start tag must be matched with its own end tag before the previous start tag can be matched.


A start tag is simply an element name framed by angle brackets:



If the element has attributes assigned to it, they belong within the start tag. An element can have multiple attributes, but they must be unique:


<TAG attribute="value">

Space is forbidden between the opening bracket and the name. It is required before each attribute assignment. It is optional before the end bracket.

Start tags should look familiar to anyone who has worked with HTML.


Each start tag must have

  • the < character

  • a name

  • the > character

Additionally, every start tag may contain:

  • Attribute assignments

  • Whitespace after the tag's name

Examples of Start Tags


Street, city, etc.

<player >

Contains legal but probably useless whitespace

<team mascot= "wildcat">

Contains valid attribute assignment

<team mascot="wildcat" color="purple">

Multiple attribute assignment is permitted

Bad Examples

< player >

Illegal whitespace before name

<team color="purple" color="white">

Duplicate attribute assignment is forbidden.

  • + Share This
  • 🔖 Save To Your Account