Example 21. DTD for an Attribute with Any Text

An attribute value can be set so that it can have any string of text. However, the "<", ">", """, or "&" can not be used.

Example 21.1 A CDATA Attribute Type:
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE rootelement [
<!ELEMENT rootelement (childelement1)>
<!ELEMENT childelement (#PCDATA)>
<!ATTLIST childelement
sampleattribute CDATA "0"
]>
<rootelement>
	<childelement sampleattribute="A CDATA attribute value.">
		Child element.
	</childelement>
</rootelement>