O'Reilly logo

Sams Teach Yourself XML in 10 Minutes by Andrew H. Watt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Attributes

An attribute is the association of an attribute name with an attribute value. For example, the markup describing this book might be represented as follows:

<book edition="1"> 
<title>Sams Teach Yourself XML in 10 Minutes</title> 
</book> 

The book element has an edition attribute, which has the value of 1.

An attribute is allowed only in the start tag of an element. The value of an attribute must be enclosed between paired double quotation marks, such as

<book edition="1"> 

or between paired apostrophes:

<book edition='1'> 

It is an error to mix these two types of delimiters. The next two line of code would cause a well-formedness error because the delimiters of the attribute value are not paired.

In the following line, the quotation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required