|
February 17, 2002 Arbitrary-Length Entity References Tips: February 2002
Yehuda Shiran, Ph.D.
|
|
There are two types of entity references. The first type is a character-based pre-defined reference, such as the >. The second type of entity reference is that of user-defined unlimited-length references. Peek again at our mydvd XML file below. The description element is free text, showing the months of the year this sales report is for:
Two months, January and February, are written explicitly. The third month is written as an entity reference, &month;. You need to get the value of this entity reference from the DTD file. The relevant ENTITY statement is:
Notice that we put < to the left of &month; and > to its right. These additions are not related to &month;.
Another example entity reference is shown in the
The entity reference &preparedby; needs to be substituted by a value from the DTD. Here is how we define it:
Here is the mydvd XML file:
People who read this tip also read these tips: Look for similar tips by subject: |