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 » Wed Dec 29, 2004 10:05 pm

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: 2101
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Thu Dec 30, 2004 4:57 pm

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