[Prev][Next][Index][Thread]

Re: those predeclared entity refs



h
One thing this discussion seems to be missing is that
    '
and
    '
are not equivalent.

Consider the following example:

<!DOCTYPE BOY [

    <!Entity % boy-name "Liam">
    <!Entity % boy
	'<!Entity % Liam "<!Entity Liam.name &#39;I am %boy-name;.&#39;>">'
    >
    %boy;
    %Liam;
    <!Element Boy - - (#PCDATA)>
]>
<Boy>ginger curly hair, bare feet, broad smile - &Liam.name;</Boy>

This produces the following nsgmls output:
(BOY
-ginger curly hair, bare feet, broad smile - I am Liam.
)BOY
C

Notice how the &#39; is interpreted as delimiting an entity value.
Now, how do you change
    I am %boy-name;.
to say
    I am Andrew's brother
without using &apos;?

You can't include a " or a ', neither with &# nor directly, because
they would end one or other parameter entity literal.

This example may appear very obscure.  I could give a larger example
in which it would no longer be obscure, as can Eliot and Michael
and Lou and others: IBMIDDOC, TEI, Davenport all use nested parameter
entity deifintions.

If you take out the nested definition, you can (with some SGML parsers)
get one more level of nesting.

Note that you can't do
    &#38;#39;
(like doing \\' in Unix shell scripts) because of the implicit
Ee after $#38; -- or at least, I assume that's why it doesn't work.

    <!entity quot "'">
    <!Entity % boy
	'<!Entity % Liam "<!Entity Liam.name &#39;I&quot;m %boy-name;.&#39;>">'
    >
does what I want:
(BOY
-ginger curly hair, bare feet, broad smile - I'm Liam.
)BOY
C

Lee