O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

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

Attribute Declarations

In addition to elements, other fundamental building blocks of XML are attributes. One way to think of attributes is to imagine that elements function as nouns, and attributes are adjectives. Attributes can be used to store information that describes or modifies the information contained within an element. For example:

<phone type="office">1-800-555-1222</phone> 

Here we have a phone element, which has the actual phone number as its content. However, without the type attribute, we wouldn't know whether this was a home phone, office phone, mobile phone, fax, or so on.

In this way, attributes can be very useful in XML documents, and in DTDs, attributes are declared in a manner similar to elements, using an ATTLIST declaration. ...

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