- 94 -
Fortunately, there is a way around this using
notations
. Notation declarations allow to tell
the parser what to do with information
of a particular format or
notation
, usually by
assigning an external application to process it for you. The parser tells the application
what program is usually associated with that particular data so the application knows
where to find it should it wish to execute it. Here’s an example:
my_format
SYSTEM
"http://my_website.com/my_application.exe">
If the XML document wants to use a file (or data) in my_format
,
it can refer to it in one of
two ways. First, it can reference it with an external entity. Second, it can include it directly
in the content of an element by assigning an attribute of type NOTATION (as described it
the
Attribute
Declaration List section
) and setting the value of that attribute to my_format.
You can also explicitly tell the parser that the contents of an entity are of a non-XML
format by using the keyword NDATA followed by the declared notation. The advantage of
doing so is that you explicitly tell the parser not to bother parsing the entity itself, rather
than letting it read through it and issue an error. Again, an example:
]>
Faraz Hoodbhoy
The important thing to note here is that because the NDATA section explicitly states that
the resume_file
entity contains non-XML data, resume_file entities cannot be referenced
from within an element’s content as opposed to the usual way by using an entity reference.
NDATA sections are hence only referenced as the value of the ENTITY or ENTITIES type
attributes.