Reputation: 280181
Given the following XML file, what do the DOCTYPE
, ENTITY
, SYSTEM
, &entity
(reference?) represent?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root [
<!ENTITY entity SYSTEM "./entity.xml">
]>
<root>
<element attribute="value">
&entity;
<child>
<!-- some more nested -->
</child>
</element>
</root>
Upvotes: 1
Views: 560
Reputation: 52888
The DOCTYPE declaration is specifying the root element (root
).
The entity declaration (ENTITY
) is pointing to the file entity.xml
on the system (SYSTEM
).
The entity reference (&entity;
) references the entity declaration named entity
. The easiest way to think of it is that &entity;
is replaced with everything that is in entity.xml
.
Here's a good link that covers entities (including parameter entities): http://www.w3.org/TR/2004/REC-xml-20040204/#sec-entity-decl
Upvotes: 2
Reputation:
It is the format in which the XML is written. This is specifically written in DTD format. For more information I suggest this guide that quickly explains how to read and understand said DTD format.
Also for more information about entities specifically, try this link as well.
Upvotes: 2