<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" style="xslt-template" id="db2html.entry">
 <info>
  <link type="guide" xref="db2html-table" group="templates"/>
  <link type="guide" xref="templates" group="db2html"/>
  <desc>Creates a <sys>td</sys> element for an <sys>entry</sys> element</desc>
 </info>
 <title>db2html.entry</title>
 <synopsis>
  <title>Parameters</title>
  <terms>
   <item>
    <title><code>$entry</code></title>
    <p>The <sys>entry</sys> element to process</p>
   </item>
   <item>
    <title><code>$colspecs</code></title>
    <p>The <sys>colspec</sys> elements currently in scope</p>
   </item>
   <item>
    <title><code>$spanspecs</code></title>
    <p>The <sys>spanspec</sys> elements currently in scope</p>
   </item>
   <item>
    <title><code>$colsep</code></title>
    <p>Whether column separators are currently enabled</p>
   </item>
   <item>
    <title><code>$rowsep</code></title>
    <p>Whether column separators are currently enabled</p>
   </item>
   <item>
    <title><code>$colpos</code></title>
    <p>The output column position currently being considered</p>
   </item>
   <item>
    <title><code>$colnum</code></title>
    <p>The actual column number of <code>$entry</code></p>
   </item>
   <item>
    <title><code>$spanstr</code></title>
    <p>The string representation of the row spans</p>
   </item>
  </terms>
 </synopsis>
 <p>This template processes a single <sys>entry</sys> element and generates <sys>td</sys> elements
 as needed.  It then calls itself on the following <sys>entry</sys> element, adjusting
 parameters as necessary.  Under certain conditions, this template may not be
 able to output a <sys>td</sys> element immediately.  In these cases, it makes whatever
 adjustments are needed and calls itself or <code xref="db2html.entry.implicit">db2html.entry.implicit</code> (which,
 in turn, calls this template again when it's finished).</p>
 <p>Three parameters are used to determine whether a <sys>td</sys> element can be output.
 The <code>$spanstr</code> parameter provides infomation about row spans in effect from
 entries in previous rows; the <code>$colpos</code> parameter specifies which column we
 would output to if we created a <sys>td</sys>; and the <code>$colnum</code> parameter specifies
 which column this <sys>entry</sys> should be in, according to any relevant <sys>colspec</sys>
 or <sys>spanspec</sys> elemets.</p>
 <p>There are two conditions that cause this template not to output a <sys>td</sys> element
 immediately: if the <code>$spanstr</code> parameter does not start with <sys>0:</sys>, and if the
 <code>$colpos</code> parameter is less than the <code>$colnum</code> parameter.</p>
 <p>The <code>$spanstr</code> parameter specifies the row spans in effect from entries in
 previous rows.  As this template iterates over the <sys>entry</sys> elements, it strips
 off parts of <code>$spanstr</code> so that only the parts relevant to the <sys>entry</sys> are
 present.  If <code>$spanstr</code> does not start with <sys>0:</sys>, then an entry in a previous
 row occupies this column position.  In this case, that value is removed from
 <code>$spanstr</code>, the <code>$colpos</code> parameter is incremented, and <code xref="db2html.entry">db2html.entry</code> is
 called again.  Additionally, since <code xref="db2html.entry.colnum">db2html.entry.colnum</code> doesn't consider
 row spans, the <code>$colnum</code> parameter may be incremented as well.</p>
 <p>If the <code>$colpos</code> parameter is less than the <code>$colnum</code> parameter, then the
 document has skipped entries by explicitly referencing a column.  This is
 allowed in CALS tables, but not in HTML.  To fill the blank spaces, we call
 <code xref="db2html.entry.implicit">db2html.entry.implicit</code>, which outputs an empty <sys>td</sys> element spanning as
 many columns as necessary to fill in the blanks.  The <code xref="db2html.entry.implicit">db2html.entry.implicit</code>
 template then calls this template again with appropriate parameter values.</p>
 <p>When this template is finally able to output a <sys>td</sys> element, it calculates
 appropriate values for the <sys>style</sys> and <sys>class</sys> attribute based on DocBook
 attributes on the <sys>entry</sys>, the relevant <sys>colspec</sys> or <sys>spanspec</sys>, and any
 relevant ancestor elements.  It then calls itself on the following <sys>entry</sys>
 element to output the next <sys>td</sys>.</p>
 <list style="compact">
  <title>Calls Templates</title>
  <item>
   <p><link xref="db2html.entry"/></p>
  </item>
  <item>
   <p><link xref="db2html.entry.colnum"/></p>
  </item>
  <item>
   <p><link xref="db2html.entry.colspan"/></p>
  </item>
  <item>
   <p><link xref="db2html.entry.implicit"/></p>
  </item>
  <item>
   <p><link xref="db2html.spanstr.pop"/></p>
  </item>
  <item>
   <p><link xref="html.class.attr"/></p>
  </item>
  <item>
   <p><link xref="html.lang.attrs"/></p>
  </item>
 </list>
</page>
