data-entities/datatext1
<!doctype test [
<!element test - - (#pcdata)>
<!entity ent cdata "text with escaped <> delimiters">
]>
<test>&ent</test>
data-entities/datatext1
data-entities/datatext2
data-entities/datatext3
OTOH, parameter entity references in data text entities do get expanded
data-entities/datatext4
data-entities/extdatatext1
The syntax for declaring external general data entities
requires using a notations; references to data text entities don't
get expanded by SP but reproduced as-is in the output (arguably this
is bogus, since when using the sgmlnorm program which doesn't output
the DTD we'll end up with invalid/non-reparseable output); $productname,
OTOH, does expand CDATA
and SDATA
data entities (but not NDATA
entities); moreover, any result document produced by $productname
will always contain a DTD
data-entities/extdatatext2
SDATA
is treated like CDATA
when used in data entity declarations
sgmlproc <your-file.sgm>
where <your-file.sgm> is replaced by the actual file
used for storing.
<!doctype test [
<!element test - - (#pcdata)>
<!entity ent cdata "text with escaped <> delimiters">
]>
<test>&ent</test>
<!doctype test [
<!element test - - (#pcdata)>
<!entity refdent cdata "text containing what looks like an &entity reference">
<!entity ent cdata "text with escaped <> delimiters and unexpanded &refdent entity references">
]>
<test>&ent</test>
<!doctype test [
<!element test - - (#pcdata)>
<!entity % refdent "parameter entity replacement text">
<!entity ent cdata "text with escaped <> delimiters and expanded %refdent parameter entity reference">
]>
<test>&ent</test>
<!doctype test [
<!element test - - (#pcdata)>
<!entity ent cdata "text with escaped <> delimiters and expanded %refdent parameter entity reference">
]>
<test>&ent</test>
<!doctype test [
<!element test - - (#pcdata)>
<!notation n system "somenotation">
<!entity ent system "extdatatext1.txt" cdata n>
]>
<test>&ent</test>
<!doctype test [
<!element test - - (#pcdata)>
<!notation n system "somenotation">
<!entity ent system "extdatatext1.txt" sdata n>
]>
<test>&ent</test>