Dónal
Dónal

Reputation: 187539

valid parsed character XML data

If I define an element such as this in a DTD

<!ELEMENT ud (#PCDATA)>

Are the following both valid?

<ud>foo &amp; bar</ud>
<ud><![CDATA[foo & bar]]></ud>

Upvotes: 0

Views: 83

Answers (1)

Oded
Oded

Reputation: 499072

Both are valid.

Placing content in a <![CDATA[]]> section effectively means that whatever is in it will be ignored by the parser.

PCDATA means only character data is allowed. CDATA means, character data, so it is allowed within a PCDATA context.

Upvotes: 1

Related Questions