Types of XML Entities

Internal

Definied locally within the DTD.

Syntax:

<!ENTITY name "entity_value">

Example:

<!ENTITY person "<name>John</name>">

External

They are used when referenced data is not definied internally.

There are two types of External Entities:

Private

SYSTEM keyword indicates that it is private external entity.

Syntax:

<!ENTITY name SYSTEM "URI">

Example:

<!ENTITY url SYSTEM "http://hacker-studio.pl">

Public

The PUBLIC keyword indicates that this is a public external entity

Syntax:

Example:

Parameter

Includes % prefix.

Syntax:

Example:

Unparsed External Entities

We can access binary content with unparsed entities.

Preventing XML parser from processing the referenced data.

Last updated