How to define CDATA type in the XML schema?
843834Jan 15 2009 — edited Aug 5 2009Hello there,
How I can define a CDATA simpleType in the XML schema? I've looked around and can not fine any usefull answers.
Also solutions in this topic do not work either: http://forums.sun.com/thread.jspa?threadID=360343&start=0&tstart=0
I have set it up like this in the schema:
-----------------------
<xs:complexType name="ResultType">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="data" type="cdata" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="cdata">
<xs:restriction base="xs:string">
<xs:pattern value="<![CDATA[]]" />
</xs:restriction>
</xs:simpleType>
----------------------
But got following error:
===================
parsing a schema...
[ERROR] InvalidRegex: Pattern value '<![CDATA[]]' is not a valid regular express
ion. The reported error was: ''[' is invalid in a character class. Write '\['.'
at column '8'.
===================
But without Pattern Value specified - I think this will be just a pure string and I need it to be a CDATA.
Thanks in advance