XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS