Ian's books
| CPU Magazine
Internal and External DTDs and the Mozilla Web Browser
As described in the February 2004 issue of CPU - Computer Power User
magazine.
Examples
A) Downloadable ZIP File
- There are several examples here -- why not download the
whole lot as a ZIP file -- feb04.zip --
and install them on your own machine?
B) The example XML documents
- data-1.xml -- Document having an
internal subset declaring a single internal entity named test
with the
value:
Liam's Chowder House <i>and<i> Grill
.
The document contains a single reference (&test;
) to
this entity.
A plain text version of this document
is available at data-1.txt.
- data-2.xml -- Document having an
internal subset only, declaring a single internal entity named
test (as with data-1.xml). However, this document contains a
reference to an undeclared entity (test2), so this should fail
on all XML processors.
A plain text version of this document
is available at data-2.txt.
- data-3.xml -- Document having an
internal subset only, declaring two external entities. One of
these entities exists (i.e. there is a file at the referenced
URL), while the other is not (there is nothing at the end of
the link).
A plain text version of this document
is available at data-3.txt.
- data-4.xml -- External subset only:
the declarations are in an external file ents.dtd,
which is
referenced from the DOCTYPE declaration. Ents.dtd declared
an internal entity (test) and an external one (part).
A plain text version of this document and DTD entity
are available at data-4.txt
and ents.txt.
- data-5.xml -- External subset plus
an internal subset: The external subset is as in data-4.xml
(ents.dtd).
Ents.dtd declares an internal entity (test) and an external one (part).
The internal subset also declares these values. The internal subset
definitions should be loaded first, and the external ones should
be ignored (if they are loaded at all).
A plain text version of this document and DTD entity
are available at data-5.txt
and ents.txt.
- data-6.xml -- No external subset, but
the internal subset loads the file ents.dtd using an external
parameter entity.
A plain text version of this document
is available at data-6.txt.
- data-7.xml -- An external subset
(ents-2.dtd) plus the same internal subset
as data-6.xml (uses a parameter entity to load ents.dtd).
The file ents-2.dtd declares an external entity called part
(the file foo.xml).
A plain text version of this document and the DTD entities are found at
data-7.txt,
ents.txt and
ents-2.txt, while the external entity can
be viewed as foo.txt.
.
C) More Information About Mozilla Chrome