1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>idref</title><link rel="stylesheet" type="text/css" href="../reference.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="../index.html" title="DocBook XSL Stylesheets: ReferenceDocumentation"><link rel="up" href="generallibrary.html" title="General Library Templates"><link rel="prev" href="xpointer.idref.html" title="xpointer.idref"><link rel="next" href="length-magnitude.html" title="length-magnitude"><link rel="copyright" href="copyright.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">idref</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="xpointer.idref.html">Prev</a></td><th width="60%" align="center">General Library Templates</th><td width="20%" align="right"><a accesskey="n" href="length-magnitude.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="idref"></a><div class="titlepage"></div>
<div class="refnamediv"><h2>idref</h2><p>
idref
— Extract IDREF from a linking element
</p></div>
<div class="refsect1"><a name="idp9515600"></a><h2>Description</h2>
<p>The <code class="function">idref</code> template accepts
any <a href="http://docbook.org/tdg5/en/html/xref.html"><code class="sgmltag-element">xref</code></a> or universally linking element as a parameter
and returns the local
ID that it points to.
If it has a <code class="sgmltag-attribute">linkend</code> attribute,
it returns that value.
If it has a <code class="sgmltag-attribute">xlink:href</code>, it
returns that value, parsed as needed to extract just
the id reference. Otherwise it returns an empty string.</p>
<a name="idref.frag"></a><pre class="programlisting">
<xsl:template name="idref">
<xsl:param name="xref" select="."></xsl:param>
<xsl:param name="linkend" select="$xref/@linkend"></xsl:param>
<xsl:param name="xpointer">
<xsl:call-template name="xpointer.idref">
<xsl:with-param name="xpointer" select="$xref/@xlink:href"></xsl:with-param>
</xsl:call-template>
</xsl:param>
<xsl:choose>
<xsl:when test="string-length($linkend) != 0">
<xsl:value-of select="$linkend"></xsl:value-of>
</xsl:when>
<xsl:when test="string-length($xpointer) != 0">
<xsl:value-of select="$xpointer"></xsl:value-of>
</xsl:when>
<!-- otherwise it's a pointer to some other document -->
</xsl:choose>
</xsl:template>
</pre>
</div>
</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="xpointer.idref.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="generallibrary.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="length-magnitude.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">xpointer.idref</td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top">length-magnitude</td></tr></table></div></body></html>
|