XSLT » Functions » unparsed-entity-uri

URI = unparsed-entity-uri('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.


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

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

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

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

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

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

Language(s): XSLT

See Also: