XSLT » Functions » unparsed-entity-uri

Syntax:
URI = unparsed-entity-uri('name')
name
The optional name attribute is the name of an unparsed entity reference. If the provided argument is not a string, it will be converted to a string by the XPath string() function.

The unparsed-entity-uri function returns an absolute URI (Uniform Resource Identifier) that gives access to declarations of unparsed entities in the Document Type Definition (DTD) of the source document.

An entity is information that can be referenced within an XML document. There are several types of entities:

  • external
  • general
  • internal
  • parameter
  • parsed
  • unparsed
This function only accesses unparsed entities which are declared in the DTD and generally contain binary data such as images. The empty string will be returned if the cited entity does not exist.

Examples

Code:
<!ENTITY Guru-pix SYSTEM "guru.gif" NDATA GIF>
Explanation:

Here is an example of an unparsed entity as it might be declared in a DTD file.

Language(s): XSLT
Code:
<GURU PIX="Guru-pix">
Explanation:

Note that an unparsed entity cannot be referenced directly, but is referenced by name as an attribute.

Language(s): XSLT
Code:
<img src="{unparsed-entity-uri(@PIX)}">
Explanation:

It would then be cited in the unparsed-entity-uri function this way.

Language(s): XSLT

See Also: