Document type declaration

There is another way to create a parameter entity declaration for an external entity. A single, un-named declaration can be embedded within the document type declaration, before the start of the optional internal subset. This declaration was introduced in the previous chapter.

A name is not needed for this entity, because there can only be one reference to it, and this reference automatically occurs at the end of the internal subset. The URL for this external entity is preceded by the 'SYSTEM' keyword:

<!DOCTYPE book SYSTEM "declarations.xml" [
  <!-- INTERNAL DECLARATIONS -->
  ...
  <!-- "declarations.xml" INSERTED HERE -->
]>

The implied insertion point for the entity content is very significant. It should be recalled that only the first occurrence of an entity is acknowledged. Declarations in the internal subset precede declarations in the inserted file, so take precedence. This mechanism can therefore be used by document authors to override some of the declarations in the entity. Authors can use, but customize a pre-defined package of entities.

Although this feature is widely used, mainly to integrate externally defined DTD constructs, this approach is not strictly necessary. It can be seen as a simplification of the following, where a normal parameter entity declaration and reference are inserted at the end of the internal subset:

<!DOCTYPE [
  <!-- INTERNAL DECLARATIONS -->
  ...
  <!-- EXTERNAL DECLARATIONS -->
  <!ENTITY % declarations SYSTEM "...">
  %declarations;
]>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.129.19