I am dealing with a DTD file which has, for instance, the following parameter entity declaration:
Code:
<!ENTITY % ContentType "CDATA" >
The purpose of this declaration is so that the DTD can later include
&ContentType; and this will be immediately replaced by the string,
CDATA, which will then be immediately used in the declaration in which it appears.
(Hence, "parameter" entity.) It's a common technique that's used to make DTDs more human-readable.
However, the
DOMDocument::schemaValidate() method of PHP-7, which uses
libxml.so under the hood, does not appear to understand this. It rejects the DTD with
"invalid element type."
Looking at the source-code to this library on GitHub, I think that I have found
(in parse.c) that it does not. But, I thought I'd ask ...
Obviously, I can circumvent the problem with a little text-editing, but it's a shame to lose that information and it seems strange to me that it
doesn't work.