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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE reference
PUBLIC "-//Norman Walsh//DTD JRefEntry V1.1//EN" "http://docbook.sourceforge.net/release/jrefentry/1.1/jrefentry.dtd">
<reference>
<referenceinfo>
<releaseinfo role="meta">
$Id: lib.xsl,v 1.7 2002/03/18 13:39:43 nwalsh Exp $
</releaseinfo>
<author><surname>Walsh</surname>
<firstname>Norman</firstname></author>
<copyright><year>1999</year><year>2000</year>
<holder>Norman Walsh</holder>
</copyright>
</referenceinfo>
<title>Library Template Reference</title>
<partintro>
<section><title>Introduction</title>
<para>This is technical reference documentation for the DocBook XSL
Stylesheets; it documents (some of) the parameters, templates, and
other elements of the stylesheets.</para>
<para>This is not intended to be <quote>user</quote> documentation.
It is provided for developers writing customization layers for the
stylesheets, and for anyone who's interested in <quote>how it
works</quote>.</para>
<para>Although I am trying to be thorough, this documentation is known
to be incomplete. Don't forget to read the source, too :-)</para>
</section>
</partintro>
<refentry id="template.string.subst">
<refnamediv>
<refname>string.subst</refname>
<refpurpose>Substitute one text string for another in a string</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="string.subst">
<xsl:param name="string"/>
<xsl:param name="target"/>
<xsl:param name="replacement"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>string.subst</function> template replaces all
occurances of <parameter>target</parameter> in <parameter>string</parameter>
with <parameter>replacement</parameter> and returns the result.
</para>
</refdescription></refentry>
<refentry id="template.xpointer.idref">
<refnamediv>
<refname>xpointer.idref</refname>
<refpurpose>Extract IDREF from an XPointer</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="xpointer.idref">
<xsl:param name="xpointer">http://...</xsl:param>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>xpointer.idref</function> template returns the
ID portion of an XPointer which is a pointer to an ID within the current
document, or the empty string if it is not.</para>
<para>In other words, <function>xpointer.idref</function> returns
<quote>foo</quote> when passed either <literal>#foo</literal>
or <literal>#xpointer(id('foo'))</literal>, otherwise it returns
the empty string.</para>
</refdescription></refentry>
<refentry id="template.length-magnitude">
<refnamediv>
<refname>length-magnitude</refname>
<refpurpose>Return the unqualified dimension from a length specification</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="length-magnitude">
<xsl:param name="length" select="'0pt'"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>length-magnitude</function> template returns the
unqualified length ("20" for "20pt") from a dimension.
</para>
</refdescription></refentry>
<refentry id="template.length-units">
<refnamediv>
<refname>length-units</refname>
<refpurpose>Return the units from a length specification</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="length-units">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'pt'"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>length-units</function> template returns the
units ("pt" for "20pt") from a length. If no units are supplied on the
length, the <parameter>defauilt.units</parameter> are returned.</para>
</refdescription></refentry>
<refentry id="template.length-spec">
<refnamediv>
<refname>length-spec</refname>
<refpurpose>Return a fully qualified length specification</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="length-spec">
<xsl:param name="length" select="'0pt'"/>
<xsl:param name="default.units" select="'pt'"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>length-spec</function> template returns the
qualified length from a dimension. If an unqualified length is given,
the <parameter>default.units</parameter> will be added to it.
</para>
</refdescription></refentry>
<refentry id="template.pi-attribute">
<refnamediv>
<refname>pi-attribute</refname>
<refpurpose>Extract a pseudo-attribute from a PI</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="pi-attribute">
<xsl:param name="pis" select="processing-instruction('')"/>
<xsl:param name="attribute">filename</xsl:param>
<xsl:param name="count">1</xsl:param>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>pi-attribute</function> template extracts a pseudo-attribute
from a processing instruction. For example, given the PI
<quote><literal><?foo bar="1" baz='red'?></literal></quote>,</para>
<programlisting><xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="processing-instruction('foo')"/>
<xsl:with-param name="attribute" select="'baz'"/>
</xsl:call-template></programlisting>
<para>will return <quote>red</quote>. This template returns the first matching
attribute that it finds. Presented with processing instructions that
contain badly formed pseudo-attributes (missing or unbalanced quotes,
for example), the template may silently return erroneous results.</para>
</refdescription></refentry>
<refentry id="template.lookup.key">
<refnamediv>
<refname>lookup.key</refname>
<refpurpose>Retrieve the value associated with a particular key in a table</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="lookup.key">
<xsl:param name="key" select="''"/>
<xsl:param name="table" select="''"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>Given a table of space-delimited key/value pairs,
the <function>lookup.key</function> template extracts the value associated
with a particular key.</para>
</refdescription></refentry>
<refentry id="template.xpath.location">
<refnamediv>
<refname>xpath.location</refname>
<refpurpose>Calculate the XPath child-sequence to the current node</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><xsl:template name="xpath.location">
<xsl:param name="node" select="."/>
<xsl:param name="path" select="''"/>
...
</xsl:template></synopsis>
</refsynopsisdiv>
<refdescription>
<para>The <function>xpath.location</function> template calculates the
absolute path from the root of the tree to the current element node.
</para>
</refdescription></refentry>
</reference>
|