Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 9f452694b2d23dacae7f9cc757f9be50 > files > 36

docbook-style-xsl-1.78.1-1.fc17.noarch.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>pad-string</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: Reference Documentation"><link rel="up" href="utility.html" title="Common » Utility Template Reference"><link rel="prev" href="template.get.doc.title.html" title="get.doc.title"><link rel="next" href="charmap.html" title="Common » Character-Map Template Reference"><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">pad-string</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="template.get.doc.title.html">Prev</a> </td><th width="60%" align="center">Common » Utility Template Reference</th><td width="20%" align="right"> <a accesskey="n" href="charmap.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="template.pad-string"></a><div class="titlepage"></div>
<div class="refnamediv"><h2>pad-string</h2><p>
pad-string
 &#8212; Right-pads or left-pads a string out to a certain length
</p></div>
<div class="refsynopsisdiv"><h2>Synopsis</h2>
<pre class="synopsis">&lt;xsl:template name="pad-string"&gt;
&lt;xsl:param name="padChar" select="' '"/&gt;
&lt;xsl:param name="leftRight"&gt;left&lt;/xsl:param&gt;
&lt;xsl:param name="padVar"/&gt;
&lt;xsl:param name="length"/&gt;
  ...
&lt;/xsl:template&gt;</pre>
</div>
<div class="refsect1"><a name="idp10023088"></a><h2>Description</h2>
    
<p>This function takes string <em class="parameter"><code>padVar</code></em> and
      pads it out in the direction <em class="parameter"><code>rightLeft</code></em> to
      the string-length <em class="parameter"><code>length</code></em>, using string
      <em class="parameter"><code>padChar</code></em> (a space character by default) as
      the padding string (note that <em class="parameter"><code>padChar</code></em> can
      be a string; it is not limited to just being a single
      character).</p>

    <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
      
<p>This function began as a copy of Nate Austin's
        <code class="function">prepend-pad</code> function in the <a class="ulink" href="http://www.dpawson.co.uk/xsl/sect2/padding.html" target="_top">Padding
          Content</a> section of Dave Pawson's <a class="ulink" href="http://www.dpawson.co.uk/xsl/index.html" target="_top">XSLT
          FAQ</a>.</p>

    </div>
  </div><div class="refsect1"><a name="idp10029312"></a><h2>Returns</h2>
  
<p>Returns a (padded) string.</p>
</div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="template.get.doc.title.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="utility.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="charmap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">get.doc.title </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Common » Character-Map Template Reference</td></tr></table></div></body></html>