CDATA Again (was: No specification for querystrings...)

On Wed, 24 Nov 1999, Russell Steven Shawn O'Connor wrote:
> On Tue, 23 Nov 1999, Dave  J Woolley wrote:
> 
> > 	The one question that this leaves is whether SGML
> > 	CDATA attributes have all entity references expanded.
> 
> References are expanded.  The confusion arises from the fact that CDATA in
> attributes is different from CDATA sections.
> 
> See <http://www.oasis-open.org/cover/topics.html#CDATA>

And, in particular, Joe English's article at

  http://www.flightlab.com/~joe/sgml/cdata.html

The key point is that attribute value literals are always parsed - more
precisely, lexically scanned - as replaceable character data, regardless
of the attribute's declared value.  The d.v. comes into play at the point
where the result of parsing the _attribute value literal_ is "converted"
into an _attribute value_: this further tokenization process may require
whitespace stripping and case folding.  Here, CDATA declared value means
that no such further processing is needed: the final contents of the
attribute value literal are just character data.  

The relevant clause from ISO 8879 is 7.9.3 'Attribute Value Specification' 
See [33] and [34] at 
 
  http://www.oreilly.com/people/staff/crism/sgmldefs.html

[It may seem that for consistency the d.v. should be RCDATA instead of
CDATA, but this is actually a subtle misunderstanding.  The sense in which
RCDATA could apply actually pertains to *all* attribute value literals
anyway.  The issue is whether the parsed literal has to be tokenized.]



Arjun

Received on Wednesday, 1 December 1999 18:02:39 UTC