[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CDATA vs. EMPTY
- From: Rob Lugt <firstname.lastname@example.org>
- To: Bjoern Hoehrmann <email@example.com>, firstname.lastname@example.org
- Date: Mon, 09 Jul 2001 09:28:56 +0100
Bjoern Hoehrmann wrote
> XML 1.0 SE says: "An element with no content is said to be empty".
> Does the following fragment have any content?
Yes it does have content. This is quite clear if you look at the grammar
 content ::= CharData? ((element | Reference | CDSect | PI |
Your content clearly contains a CDSect. The fact that the CDSect has no
data is not relevant to the production.
> The Recommendation further reads: "The representation of an empty
> element is either a start-tag immediately followed by an end-tag, or an
> empty-element tag". This is true for the fragment in it's canonical
True, but then you could argue the same for this:-
<elem><!-- this isn't empty unless the comment is removed --></elem>
<!ENTITY null "">