Elements and Types

All programming languages make a distinction between a variable, which is a named location in memory, and a variable's data type, which can put constraints on the variable's range of values or how the variable should be interpreted. In general, the closest thing that XML 1.0 DTDs have to this separation is PCDATA for parsed character data and CDATA for (unparsed) character data. The XML Schema Recommendation implements a more conventional view of variables and data types. (I should add “in general” because this is true for Elements. Attribute declarations have a bit more expressive power since they can be declared as CDATA, ID, IDREF, and so on.)

NOTE “Data Type” or “Datatype”?

The Schema Recommendation uses “datatype,” while ...

Get Using XML with Legacy Business Applications 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.