<html>
<head>
<title>unparsed-entity-uri() Function</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">unparsed-entity-uri() Function</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">
Returns the URI of the unparsed entity with the specified name. If there is no such entity, <span class="LITERAL">unparsed-entity-uri</span> returns an empty string.</td></tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Inputs</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>The name of the unparsed entity.</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Output</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>The URI of the unparsed entity with the specified name. </p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Defined in</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>XSLT section 12.4, Miscellaneous Additional Functions. </p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Example</td>
</tr>
<tr>
<td colspan="2" class="description">
<!--<?troff .hw picture?>-->
<p>Unparsed entities are rarely used; they refer to non-XML data, as in the entity <span class="LITERAL">author-picture</span> in this XML document:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE book [
  &lt;!ENTITY author-picture SYSTEM "dougtidwell.jpg" NDATA JPEG&gt;
]&gt;
&lt;book&gt;
  &lt;prolog cover-image="author-picture"/&gt;
  &lt;body&gt;
    &lt;p&gt;Pretend that lots of useful content appears here.&lt;/p&gt;
  &lt;/body&gt;
&lt;/book&gt;</pre></span>
<p>We'll use this stylesheet to process our unparsed entity:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

  &lt;xsl:output method="text"/&gt;
<!--<?troff .Nd 10?>-->
  &lt;xsl:variable name="newline"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
  &lt;/xsl:variable&gt;

  &lt;xsl:template match="/"&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;A test of the unparsed-entity-uri() function:&lt;/xsl:text&gt;

    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:value-of select="$newline"/&gt;
    &lt;xsl:text&gt;   The cover image is located at &lt;/xsl:text&gt;
    &lt;xsl:value-of select="unparsed-entity-uri(/book/prolog/@cover-image)"/&gt;
    &lt;xsl:text&gt;.&lt;/xsl:text&gt;
    &lt;xsl:value-of select="$newline"/&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>When we transform the XML document with our stylesheet, the results look like this:</p>
<span class="PROGRAMLISTING"><pre>

A test of the unparsed-entity-uri() function:

   The cover image is located at file:///D:/O'Reilly/dougtidwell.jpg.

</pre></span>
<p>The URI of the unparsed entity is based on the base URI of the XML document itself.






</p>
</td>
</tr>
</table>
</div>
</body>
</html>