[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: PCDATA element type and CDATA attribute type

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: Jesper Tverskov <jesper.tverskov@gmail.com>
  • Date: Mon, 6 Feb 2012 11:04:55 -0500

Re:  PCDATA element type and CDATA attribute type
Jesper Tverskov scripsit:

> Having an element type called PCDATA and an attribute type called
> CDATA is misleading since they are exactly the same for all practical
> purposes. They are both parsed in the sense that character references
> are replaced with the character and named references are expanded and
> in the sense that we get wellformedness errors in both if they contain
> markup?

In CDATA, a < character is not interpreted as the beginning of markup.
This is true of both CDATA attributes (where it's an error) and CDATA
sections (where it is treated as a literal).

> One could just as well have decided to call both PCDATA or CDATA. The
> background for the two types are probably that it was called PCDATA
> for elements to contrast it with a CDATA section escaping markup ...
> forgetting to call it PCDATA also in attributes. A more sensible
> working group would probably have decided for having just one "string"
> data type to be used in both elements and attributes, and just one
> name.

The XML WG was constrained by SGML, where CDATA elements are also
possible.  The HTML SCRIPT and STYLE elements were originally declared
as CDATA, but they are now terminated only by the appropriate end-tag,
whereas SGML CDATA is terminated by any end-tag (and then it's an error
if it's the wrong one).

-- 
Possession is said to be nine points of the law,                John Cowan
but that's not saying how many points the law might have.       cowan@ccil.org
        --Thomas A. Cowan (law professor and my father)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.