Use of '&' in element of XML Document
John E. Simpson
simpson at polaris.net
Wed Jul 28 06:05:57 BST 1999
Wait wait wait. Major disconnect here. It's hard enough to parse markup
without having to parse English, too. :)
To recap, the contentious paragraph on predefined entities at:
says, in its entirety:
All XML processors must recognize these entities whether they are
declared or not. For interoperability, valid XML documents should
declare these entities, like any others, before using them. If the
entities in question are declared, they must be declared as
internal entities whose replacement text is the single character
being escaped or a character reference to that character, as
Of this, at 06:45 PM 07/27/1999 -0500, Paul Grosso wrote:
>You cannot redeclare pre-defined entities, and no declaration is
It's possible I'm missing something extremely (perversely) subtle, but I
don't get the sense of "*cannot* redeclare" [emphasis added] at all in the
above passage. True, it does say that "all XML processors must recognize"
the predefined entities. If no redeclaration at all were permitted, the
sentence beginning "If the entities in question are declared" wouldn't make
a lot of sense, right?
Furthermore, I think that saying, archly:
>Use of a DTD does not imply validity. DTDs can be used in the
>well-formedness case too.
is really a bit of hair-splitting unwarranted by the simple question asked
in the first message in this thread. Malliks, the original questioner,
included this DTD fragment in the post:
<!ELEMENT COMPANY_NAME (#PCDATA)>
and went on to ask:
>How should the DTD be written to accomadate
>characters such as &?
If one were determined, I guess he/she could interpret the question as
asking "Assume I want to develop a DTD for my documents but don't care
whether they're valid...." I'm not that determined.
>And the following table gives the pre-definitions. The original [i.e., my]
>response to this question showed a different declaration for amp,
>and that would not be allowable.
About the table, I agree with Richard Tobin's assessment in another post:
>I don't think it's clear whether the definitions "shown below" are
>meant to be the only allowable ones, or are examples with the rest of
>the sentence being the actual rule. If it's the former, it should be
>expressed more clearly.
Richard had earlier pointed out the typo in the entity declaration, and I
acknowledged that it was a typo. So disallowing the "different declaration
for amp," yeah, you may be right about that. But allowing *no* declaration?
[As for poor Malliks: God only knows what you're to make of all this!]
John E. Simpson | The secret of eternal youth
simpson at polaris.net | is arrested development.
http://www.flixml.org | -- Alice Roosevelt Longworth
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev