Checking for CDATA section with XML Schema

This should cover W3C XML Schema, Relax NG and DTD related problems.
Juergen

Checking for CDATA section with XML Schema

Post by Juergen »

Hi,

I'm working with the following XML data:
---
<book>
<title><![CDATA[A Book Title]]></title>
</book>
---

Is it possible to check for the existence of the <![CDATA[...]]> section with XML Schema and only accept it if the CDATA tag is present?

Thanks for any help.

Regards,
Juergen
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Juergen,

No, you cannot do this. XML Schema does not distinguish between

<book>
<title><![CDATA[A Book Title]]></title>
</book>

and

<book>
<title><A Book Title</title>
</book>

Best Regards,
George
Post Reply