RE: Allow CDATA sections in strings

> -----Original Message-----
> From:	Ashok Malhotra [SMTP:petsa@us.ibm.com]
> Sent:	Thursday, January 25, 2001 11:16 AM
> To:	XML Schema Comments
> Cc:	Francisco Curbera
> Subject:	Allow CDATA sections in strings
> 
> Paco Curbera who is using schema in interesting ways asked my whether
> XML CDATA sections could be included within values declared as xsd:string?
> And can markup be included in the content of something declared as string?
> My answer was that you could put anything within strings.  The content
> would
> not be interpreted or validated (except that < and & are not alloed and
> must
> be coded as &lt; and &amp; )
> 
> Is this correct?
> 
Almost.  CDATA section processing happens during construction of the input
info set.

Yes, CDATA sections are allowed in _element content_ that is declared to be
of type xsd:string (you can't have CDATA sections in attribute values).
However, within a CDATA you do NOT need to escape < and & (that's what the
CDATA section does).

> Some of the confusion arose because of our inappropriately named datatype
> formerly known as CDATA.  I told him we had voted to rename it.
> 
No offense, but it wasn't schema that has inappropriately named something:
XML uses the term CDATA in two different contexts...

pvb

Received on Thursday, 25 January 2001 15:06:53 UTC