W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

RE: Allow CDATA sections in strings

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Thu, 25 Jan 2001 11:51:04 -0800
Message-Id: <376E771642C1D2118DC300805FEAAF43014BA969@pars-exch-1.ca.kp.org>
To: XML Schema Comments <www-xml-schema-comments@w3.org>
Cc: Francisco Curbera <curbera@us.ibm.com>
> -----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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT