Attribute Types

So far, I've used just the CDATA attribute type when declaring attributes—and, in fact, that's probably the most common declaration type for attributes because it allows you to use simple text for the attribute's value. However, you can specify a number of different attribute types, and I'll take a look at them here. These types are not (not yet, anyway) detailed enough to indicate specific data types such as float, int, or double, but they can provide you with some ability to check the syntax of a document.

CDATA

The most simple attribute type you can have is CDATA, which is simple character data. That means the attribute may be set to a value which is any string of text, as long as the string does not contain markup. The requirement ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.