This first template rule generates the outer-level shell for a delivery context.
In an override stylesheet, the same call to "chapter-setup" must be issued to
maintain the consistency of overall look'n'feel of the output HTML.
Match on the first DITA element -or- the first root 'topic' element.
<xsl:template name="gen-topic"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><xsl:choose><xsl:when test="parent::dita and not(preceding-sibling::*)"><!-- Do not reset xml:lang if it is already set on <html> --><xsl:apply-templates select="." mode="set-output-class"/></xsl:when><xsl:otherwise><xsl:call-template name="commonattributes"/></xsl:otherwise></xsl:choose><xsl:call-template name="gen-toc-id"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setidaname"/><xsl:apply-templates select="." mode="outputContentsWithFlags"/></xsl:template>
NESTED TOPIC TITLES (sensitive to nesting depth, but are still processed for contained markup)
1st level - topic/title
Condensed topic title into single template without priorities; use $headinglevel to set heading.
If desired, somebody could pass in the value to manually set the heading level
<xsl:template match="*[contains(@class,' topic/body ')]" name="topic.body"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><div><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setidaname"/><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><!-- here, you can generate a toc based on what's a child of body --><!--xsl:call-template name="gen-sect-ptoc"/--><!-- Works; not always wanted, though; could add a param to enable it.--><!-- Insert prev/next links. since they need to be scoped by who they're 'pooled' with, apply-templates in 'hierarchylink' mode to linkpools (or related-links itself) when they have children that have any of the following characteristics:
- role=ancestor (used for breadcrumb)
- role=next or role=previous (used for left-arrow and right-arrow before the breadcrumb)
- importance=required AND no role, or role=sibling or role=friend or role=previous or role=cousin (to generate prerequisite links)
- we can't just assume that links with importance=required are prerequisites, since a topic with eg role='next' might be required, while at the same time by definition not a prerequisite --><!-- Added for DITA 1.1 "Shortdesc proposal" --><!-- get the abstract para --><xsl:apply-templates select="preceding-sibling::*[contains(@class,' topic/abstract ')]" mode="outofline"/><!-- get the shortdesc para --><xsl:apply-templates select="preceding-sibling::*[contains(@class,' topic/shortdesc ')]" mode="outofline"/><!-- Insert pre-req links - after shortdesc - unless there is a prereq section about --><xsl:apply-templates select="following-sibling::*[contains(@class,' topic/related-links ')]" mode="prereqs"/><xsl:apply-templates/><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></div><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*[contains(@class,' topic/example ')]" name="topic.example"><div class="example"><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-toc-id"/><xsl:call-template name="setidaname"/><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="example-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="example-fmt"/></xsl:otherwise></xsl:choose></div><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*[contains(@class,' topic/ul ')]" name="topic.ul"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="ul-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="ul-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/sl ')]" name="topic.sl"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><!-- edited by William on 2009-06-16 for bullet bug:2782503 start--><!--br/--><!-- edited by William on 2009-06-16 for bullet bug:2782503 end--><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:choose><!-- draft rev mode, add div w/ rev attr value --><xsl:when test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:variable name="revtest"><!-- Flag the revision? 1=yes; 0=no --><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><div class="{@rev}"><xsl:apply-templates select="." mode="sl-fmt"/></div></xsl:when><xsl:otherwise><xsl:apply-templates select="." mode="sl-fmt"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:apply-templates select="." mode="sl-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/itemgroup ')]" name="topic.itemgroup"><!-- insert a space before all but the first itemgroups in a LI --><xsl:variable name="itemgroupcount"><xsl:number count="*[contains(@class,' topic/itemgroup ')]"/></xsl:variable><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><xsl:if test="$itemgroupcount>'1'"><xsl:text></xsl:text></xsl:if><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="revtext"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></xsl:template>
<xsl:template match="*[contains(@class,' topic/dl ')]" name="topic.dl"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="dl-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="dl-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
SF Patch 2185423: condensed code so that dt processing is not repeated for keyref or when $dtcount!=1
Code could be reduced further by compressing the flagging templates.
<xsl:template match="*[contains(@class,' topic/dt ')]" mode="output-dt"><!-- insert a blank line before only the first DT in a DLENTRY; count which DT this is --><xsl:variable name="dtcount"><xsl:number count="*[contains(@class,' topic/dt ')]"/></xsl:variable><xsl:variable name="dt-class"><xsl:choose><!-- handle non-compact list items --><xsl:when test="$dtcount=1 and ../../@compact='no'">dltermexpand</xsl:when><xsl:otherwise>dlterm</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="flagrules"><xsl:call-template name="getrules"/><xsl:call-template name="getrules-parent"/></xsl:variable><dt class="{$dt-class}"><xsl:apply-templates select="../@xml:lang"/><!-- Get from DLENTRY, then override with local --><xsl:call-template name="commonattributes"><xsl:with-param name="default-output-class" select="$dt-class"/></xsl:call-template><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setidaname"/><!-- handle ID on a DLENTRY --><xsl:if test="$dtcount=1 and parent::*/@id"><xsl:call-template name="parent-id"/></xsl:if><!-- handle non-compact DLs dl/dlentry/dt--><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="revtext"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:apply-templates select="." mode="pull-in-title"><xsl:with-param name="type" select="' dt '"/><xsl:with-param name="displaytext" select="normalize-space(text())"/></xsl:apply-templates></dt></xsl:template>
<xsl:template match="*[contains(@class,' topic/dd ')]" name="topic.dd"><!-- insert a blank line before all but the first DD in a DLENTRY; count which DD this is --><!-- SF Patch 2185423: condensed code so that dd processing is not repeated when $ddcount!=1 --><xsl:variable name="ddcount"><xsl:number count="*[contains(@class,' topic/dd ')]"/></xsl:variable><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><dd><xsl:if test="$ddcount!=1"><!-- para space before 2 thru N --><xsl:attribute name="class">ddexpand</xsl:attribute></xsl:if><xsl:apply-templates select="../@xml:lang"/><!-- Get from DLENTRY, then override with local --><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setidaname"/><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="revblock"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></dd><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*[contains(@class,' topic/tm ')]" name="topic.tm"><xsl:apply-templates/><!-- output the TM content --><xsl:variable name="Ltmclass"><xsl:call-template name="convert-to-lower"><!-- ensure lowercase for comparisons --><xsl:with-param name="inputval" select="@tmclass"/></xsl:call-template></xsl:variable><!-- If this is a good class, continue... --><xsl:if test="$Ltmclass='ibm' or $Ltmclass='ibmsub' or $Ltmclass='special'"><!-- Test for TM area's language --><xsl:variable name="tmtest"><xsl:call-template name="tm-area"/></xsl:variable><!-- If this language should get trademark markers, continue... --><xsl:if test="$tmtest='tm'"><xsl:variable name="tmvalue"><xsl:value-of select="@trademark"/></xsl:variable><!-- Determine if this is in a title, and should be marked --><xsl:variable name="usetitle"><xsl:if test="ancestor::*[contains(@class,' topic/title ')]/parent::*[contains(@class,' topic/topic ')]"><xsl:choose><!-- Not the first one in a title --><xsl:when test="generate-id(.)!=generate-id(key('tm',.)[1])">skip</xsl:when><!-- First one in the topic, BUT it appears in a shortdesc or body --><xsl:when test="//*[contains(@class,' topic/shortdesc ') or contains(@class,' topic/body ')]//*[contains(@class,' topic/tm ')][@trademark=$tmvalue]">skip</xsl:when><xsl:otherwise>use</xsl:otherwise></xsl:choose></xsl:if></xsl:variable><!-- Determine if this is in a body, and should be marked --><xsl:variable name="usebody"><xsl:choose><!-- If in a title or prolog, skip --><xsl:when test="ancestor::*[contains(@class,' topic/title ') or contains(@class,' topic/prolog ')]/parent::*[contains(@class,' topic/topic ')]">skip</xsl:when><!-- If first in the document, use it --><xsl:when test="generate-id(.)=generate-id(key('tm',.)[1])">use</xsl:when><!-- If there is another before this that is in the body or shortdesc, skip --><xsl:when test="preceding::*[contains(@class,' topic/tm ')][@trademark=$tmvalue][ancestor::*[contains(@class,' topic/body ') or contains(@class,' topic/shortdesc ')]]">skip</xsl:when><!-- Otherwise, any before this must be in a title or ignored section --><xsl:otherwise>use</xsl:otherwise></xsl:choose></xsl:variable><!-- If it should be used in a title or used in the body, output your favorite TM marker based on the attributes --><xsl:if test="$usetitle='use' or $usebody='use'"><xsl:choose><!-- ignore @tmtype=service or anything else --><xsl:when test="@tmtype='tm'">™</xsl:when><xsl:when test="@tmtype='reg'"><sup>®</sup></xsl:when><xsl:otherwise/></xsl:choose></xsl:if></xsl:if></xsl:if></xsl:template>
Template
tm-area
Documentation
Description
Test for in TM area: returns "tm" when parent's @xml:lang needs a trademark language;
Otherwise, leave blank.
Use the TM for US English and the AP languages (Japanese, Korean, and both Chinese).
Ignore the TM for all other languages.
<xsl:template name="tm-area"><xsl:variable name="parentlang"><xsl:call-template name="getLowerCaseLang"/></xsl:variable><xsl:choose><xsl:when test="$parentlang='en-us' or $parentlang='en'">tm</xsl:when><xsl:when test="$parentlang='ja-jp' or $parentlang='ja'">tm</xsl:when><xsl:when test="$parentlang='ko-kr' or $parentlang='ko'">tm</xsl:when><xsl:when test="$parentlang='zh-cn' or $parentlang='zh'">tm</xsl:when><xsl:when test="$parentlang='zh-tw' or $parentlang='zh'">tm</xsl:when><xsl:otherwise/></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/pre ')]" name="topic.pre"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="pre-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="pre-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/lines ')]" name="topic.lines"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="lines-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="lines-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/fig ')]" name="topic.fig"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="fig-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="fig-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/figgroup ')]" name="topic.figgroup"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="figgroup-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="figgroup-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/image ')]" name="topic.image"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><!-- build any pre break indicated by style --><xsl:choose><xsl:when test="parent::fig[contains(@frame,'top ')]"><!-- NOP if there is already a break implied by a parent property --></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="(@placement='break')"><br/><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="flagcheck"/></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setaname"/><xsl:choose><xsl:when test="@placement='break'"><!--Align only works for break--><xsl:choose><xsl:when test="@align='left'"><div class="imageleft"><xsl:call-template name="topic-image"/></div></xsl:when><xsl:when test="@align='right'"><div class="imageright"><xsl:call-template name="topic-image"/></div></xsl:when><xsl:when test="@align='center'"><div class="imagecenter"><xsl:call-template name="topic-image"/></div></xsl:when><xsl:otherwise><xsl:call-template name="topic-image"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:call-template name="topic-image"/></xsl:otherwise></xsl:choose><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><!-- build any post break indicated by style --><xsl:if test="not(@placement='inline')"><br/></xsl:if><!-- image name for review --><xsl:if test="$ARTLBL='yes'">[<xsl:value-of select="@href"/>]</xsl:if></xsl:template>
<xsl:template name="topic-image"><!-- now invoke the actual content and its alt text --><xsl:element name="img"><xsl:call-template name="commonattributes"><xsl:with-param name="default-output-class"><xsl:if test="@placement='break'"><!--Align only works for break--><xsl:choose><xsl:when test="@align='left'">imageleft</xsl:when><xsl:when test="@align='right'">imageright</xsl:when><xsl:when test="@align='center'">imagecenter</xsl:when></xsl:choose></xsl:if></xsl:with-param></xsl:call-template><xsl:call-template name="setid"/><xsl:choose><xsl:when test="*[contains(@class, ' topic/longdescref ')]"><xsl:apply-templates select="*[contains(@class, ' topic/longdescref ')]"/></xsl:when><xsl:otherwise><xsl:apply-templates select="@longdescref"/></xsl:otherwise></xsl:choose><xsl:apply-templates select="@href|@height|@width"/><xsl:choose><xsl:when test="*[contains(@class,' topic/alt ')]"><xsl:variable name="alt-content"><xsl:apply-templates select="*[contains(@class,' topic/alt ')]" mode="text-only"/></xsl:variable><xsl:attribute name="alt"><xsl:value-of select="normalize-space($alt-content)"/></xsl:attribute></xsl:when><xsl:when test="@alt"><xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute></xsl:when></xsl:choose></xsl:element></xsl:template>
<xsl:template match="*[contains(@class,' topic/table ')]" name="topic.table"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="table-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="table-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/table ')]" mode="table-fmt"><xsl:value-of select="$newline"/><!-- special case for IE & NS for frame & no rules - needs to be a double table --><xsl:variable name="colsep"><xsl:choose><xsl:when test="*[contains(@class,' topic/tgroup ')]/@colsep"><xsl:value-of select="*[contains(@class,' topic/tgroup ')]/@colsep"/></xsl:when><xsl:when test="@colsep"><xsl:value-of select="@colsep"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="rowsep"><xsl:choose><xsl:when test="*[contains(@class,' topic/tgroup ')]/@rowsep"><xsl:value-of select="*[contains(@class,' topic/tgroup ')]/@rowsep"/></xsl:when><xsl:when test="@rowsep"><xsl:value-of select="@rowsep"/></xsl:when></xsl:choose></xsl:variable><xsl:choose><xsl:when test="@frame='all' and $colsep='0' and $rowsep='0'"><table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td><xsl:value-of select="$newline"/><xsl:call-template name="dotable"/></td></tr></table></xsl:when><xsl:when test="@frame='top' and $colsep='0' and $rowsep='0'"><hr/><xsl:value-of select="$newline"/><xsl:call-template name="dotable"/></xsl:when><xsl:when test="@frame='bot' and $colsep='0' and $rowsep='0'"><xsl:call-template name="dotable"/><hr/><xsl:value-of select="$newline"/></xsl:when><xsl:when test="@frame='topbot' and $colsep='0' and $rowsep='0'"><hr/><xsl:value-of select="$newline"/><xsl:call-template name="dotable"/><hr/><xsl:value-of select="$newline"/></xsl:when><xsl:when test="not(@frame) and $colsep='0' and $rowsep='0'"><table cellpadding="4" cellspacing="0" border="1" class="tableborder"><tr><td><xsl:value-of select="$newline"/><xsl:call-template name="dotable"/></td></tr></table></xsl:when><xsl:otherwise><div class="tablenoborder"><xsl:call-template name="dotable"/></div></xsl:otherwise></xsl:choose><xsl:value-of select="$newline"/></xsl:template>
<xsl:template name="dotable"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setaname"/><table cellpadding="4" cellspacing="0" summary=""><xsl:variable name="colsep"><xsl:choose><xsl:when test="*[contains(@class,' topic/tgroup ')]/@colsep"><xsl:value-of select="*[contains(@class,' topic/tgroup ')]/@colsep"/></xsl:when><xsl:when test="@colsep"><xsl:value-of select="@colsep"/></xsl:when></xsl:choose></xsl:variable><xsl:variable name="rowsep"><xsl:choose><xsl:when test="*[contains(@class,' topic/tgroup ')]/@rowsep"><xsl:value-of select="*[contains(@class,' topic/tgroup ')]/@rowsep"/></xsl:when><xsl:when test="@rowsep"><xsl:value-of select="@rowsep"/></xsl:when></xsl:choose></xsl:variable><xsl:call-template name="setid"/><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setscale"/><!-- When a table's width is set to page or column, force it's width to 100%. If it's in a list, use 90%.
Otherwise, the table flows to the content --><xsl:choose><xsl:when test="(@expanse='page' or @pgwide='1')and (ancestor::*[contains(@class,' topic/li ')] or ancestor::*[contains(@class,' topic/dd ')] )"><xsl:attribute name="width">90%</xsl:attribute></xsl:when><xsl:when test="(@expanse='column' or @pgwide='0') and (ancestor::*[contains(@class,' topic/li ')] or ancestor::*[contains(@class,' topic/dd ')] )"><xsl:attribute name="width">90%</xsl:attribute></xsl:when><xsl:when test="(@expanse='page' or @pgwide='1')"><xsl:attribute name="width">100%</xsl:attribute></xsl:when><xsl:when test="(@expanse='column' or @pgwide='0')"><xsl:attribute name="width">100%</xsl:attribute></xsl:when></xsl:choose><xsl:choose><xsl:when test="@frame='all' and $colsep='0' and $rowsep='0'"><xsl:attribute name="border">0</xsl:attribute></xsl:when><xsl:when test="not(@frame) and $colsep='0' and $rowsep='0'"><xsl:attribute name="border">0</xsl:attribute></xsl:when><xsl:when test="@frame='sides'"><xsl:attribute name="frame">vsides</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:when><xsl:when test="@frame='top'"><xsl:attribute name="frame">above</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:when><xsl:when test="@frame='bottom'"><xsl:attribute name="frame">below</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:when><xsl:when test="@frame='topbot'"><xsl:attribute name="frame">hsides</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:when><xsl:when test="@frame='none'"><xsl:attribute name="frame">void</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="frame">border</xsl:attribute><xsl:attribute name="border">1</xsl:attribute></xsl:otherwise></xsl:choose><xsl:choose><xsl:when test="@frame='all' and $colsep='0' and $rowsep='0'"><xsl:attribute name="border">0</xsl:attribute></xsl:when><xsl:when test="not(@frame) and $colsep='0' and $rowsep='0'"><xsl:attribute name="border">0</xsl:attribute></xsl:when><xsl:when test="$colsep='0' and $rowsep='0'"><xsl:attribute name="rules">none</xsl:attribute><xsl:attribute name="border">0</xsl:attribute></xsl:when><xsl:when test="$colsep='0'"><xsl:attribute name="rules">rows</xsl:attribute></xsl:when><xsl:when test="$rowsep='0'"><xsl:attribute name="rules">cols</xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="rules">all</xsl:attribute></xsl:otherwise></xsl:choose><xsl:call-template name="place-tbl-lbl"/><!-- title and desc are processed elsewhere --><xsl:apply-templates select="*[contains(@class,' topic/tgroup ')]"/></table><xsl:value-of select="$newline"/><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></xsl:template>
<xsl:template name="doentry"><xsl:variable name="this-colname"><xsl:value-of select="@colname"/></xsl:variable><!-- Rowsep/colsep: Skip if the last row or column. Only check the entry and colsep;
if set higher, will already apply to the whole table. --><xsl:variable name="flagrules"><xsl:call-template name="getrules"/><xsl:call-template name="getrules-parent"/></xsl:variable><xsl:variable name="framevalue"><xsl:choose><xsl:when test="ancestor::*[contains(@class,' topic/table ')][1]/@frame and ancestor::*[contains(@class,' topic/table ')][1]/@frame!=''"><xsl:value-of select="ancestor::*[contains(@class,' topic/table ')][1]/@frame"/></xsl:when><xsl:otherwise>all</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="rowsep"><xsl:choose><!-- If there are more rows, keep rows on --><xsl:when test="not(../following-sibling::*)"><xsl:choose><xsl:when test="$framevalue='all' or $framevalue='bottom' or $framevalue='topbot'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="@rowsep"><xsl:value-of select="@rowsep"/></xsl:when><xsl:when test="../@rowsep"><xsl:value-of select="../@rowsep"/></xsl:when><xsl:when test="@colname and ../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname]/@rowsep"><xsl:value-of select="../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname]/@rowsep"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable><xsl:variable name="colsep"><xsl:choose><!-- If there are more columns, keep rows on --><xsl:when test="not(following-sibling::*)"><xsl:choose><xsl:when test="$framevalue='all' or $framevalue='sides'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="@colsep"><xsl:value-of select="@colsep"/></xsl:when><xsl:when test="@colname and ../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname]/@colsep"><xsl:value-of select="../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname]/@colsep"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><xsl:when test="$rowsep='0' and $colsep='0'"><xsl:attribute name="class">nocellnorowborder</xsl:attribute></xsl:when><xsl:when test="$rowsep='1' and $colsep='0'"><xsl:attribute name="class">row-nocellborder</xsl:attribute></xsl:when><xsl:when test="$rowsep='0' and $colsep='1'"><xsl:attribute name="class">cell-norowborder</xsl:attribute></xsl:when><xsl:when test="$rowsep='1' and $colsep='1'"><xsl:attribute name="class">cellrowborder</xsl:attribute></xsl:when></xsl:choose><xsl:call-template name="commonattributes"/><xsl:if test="@morerows"><xsl:attribute name="rowspan"><!-- set the number of rows to span --><xsl:value-of select="@morerows+1"/></xsl:attribute></xsl:if><xsl:if test="@spanname"><xsl:attribute name="colspan"><!-- get the number of columns to span from the corresponding spanspec --><xsl:call-template name="find-spanspec-colspan"/></xsl:attribute></xsl:if><xsl:if test="@namest and @nameend"><!-- get the number of columns to span from the specified named column values --><xsl:attribute name="colspan"><xsl:call-template name="find-colspan"/></xsl:attribute></xsl:if><!-- If align is on the tgroup, use it (parent=row, then tbody|thead|tfoot, then tgroup) --><xsl:if test="../../../@align"><xsl:attribute name="align"><xsl:value-of select="../../../@align"/></xsl:attribute></xsl:if><!-- If align is specified on a colspec or spanspec, that takes priority over tgroup --><xsl:if test="@colname"><!-- Removed $this-colname variable, because it is declared above --><xsl:if test="../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname][@align]"><xsl:attribute name="align"><xsl:value-of select="../../../*[contains(@class,' topic/colspec ')][@colname=$this-colname]/@align"/></xsl:attribute></xsl:if></xsl:if><xsl:if test="@spanname"><xsl:variable name="this-spanname"><xsl:value-of select="@spanname"/></xsl:variable><xsl:if test="../../../*[contains(@class,' topic/spanspec ')][@spanname=$this-spanname][@align]"><xsl:attribute name="align"><xsl:value-of select="../../../*[contains(@class,' topic/spanspec ')][@spanname=$this-spanname]/@align"/></xsl:attribute></xsl:if></xsl:if><!-- If align is locally specified, that takes priority over all --><xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:if><xsl:if test="@char"><xsl:attribute name="char"><xsl:value-of select="@char"/></xsl:attribute></xsl:if><xsl:if test="@charoff"><xsl:attribute name="charoff"><xsl:value-of select="@charoff"/></xsl:attribute></xsl:if><xsl:choose><xsl:when test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign"/></xsl:attribute></xsl:when><xsl:when test="ancestor::*[contains(@class,' topic/row ')]/@valign"><xsl:attribute name="valign"><xsl:value-of select="ancestor::*[contains(@class,' topic/row ')]/@valign"/></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="valign">top</xsl:attribute></xsl:otherwise></xsl:choose><xsl:if test="../../../*[contains(@class,' topic/colspec ')]/@colwidth and not(@namest) and not(@nameend) and not(@spanspec)"><xsl:variable name="entrypos"><!-- Current column --><xsl:call-template name="find-entry-start-position"/></xsl:variable><xsl:variable name="totalwidth"><!-- Total width of the column, in units --><xsl:apply-templates select="../../../*[contains(@class,' topic/colspec ')][1]" mode="count-colwidth"/></xsl:variable><xsl:variable name="thiswidth"><!-- Width of this column, in units --><xsl:choose><xsl:when test="../../../*[contains(@class,' topic/colspec ')][number($entrypos)]/@colwidth"><xsl:value-of select="substring-before(../../../*[contains(@class,' topic/colspec ')][number($entrypos)]/@colwidth,'*')"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable><!-- Width = width of this column / width of table, times 100 to make a percent --><xsl:attribute name="width"><xsl:value-of select="($thiswidth div $totalwidth) * 100"/><xsl:text>%</xsl:text></xsl:attribute></xsl:if><!-- If @rowheader='firstcol' on table, and this entry is in the first column,
output an ID and the firstcol class --><xsl:if test="../../../../@rowheader='firstcol'"><xsl:variable name="startpos"><xsl:call-template name="find-entry-start-position"/></xsl:variable><xsl:if test="number($startpos)=1"><xsl:attribute name="class">firstcol</xsl:attribute><xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute></xsl:if></xsl:if><xsl:choose><!-- When entry is in a thead, output the ID --><xsl:when test="parent::*/parent::*[contains(@class,' topic/thead ')]"><xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute></xsl:when><!-- otherwise, add @headers if needed --><xsl:otherwise><xsl:call-template name="add-headers-attribute"/></xsl:otherwise></xsl:choose><xsl:choose><!-- When entry is empty, output a blank --><xsl:when test="not(*|text()|processing-instruction())"><xsl:text disable-output-escaping="yes"> </xsl:text><!-- nbsp --></xsl:when><xsl:otherwise><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:variable name="revtest-row"><xsl:if test="../@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="../@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Entry Rev is active - add the span --><span class="{@rev}"><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:apply-templates/><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></span></xsl:when><xsl:when test="$revtest-row=1"><!-- Row Rev is active - add the span --><span class="{../@rev}"><xsl:call-template name="start-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:apply-templates/><xsl:call-template name="end-revflag-parent"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></span></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates/></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/colspec ')]" mode="count-colwidth"><xsl:param name="totalwidth">0</xsl:param><!-- Total counted width so far --><xsl:variable name="thiswidth"><!-- Width of this column --><xsl:choose><xsl:when test="@colwidth"><xsl:value-of select="substring-before(@colwidth,'*')"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable><!-- If there are more colspecs, continue, otherwise return the current count --><xsl:choose><xsl:when test="following-sibling::*[contains(@class,' topic/colspec ')]"><xsl:apply-templates select="following-sibling::*[contains(@class,' topic/colspec ')][1]" mode="count-colwidth"><xsl:with-param name="totalwidth" select="$totalwidth + $thiswidth"/></xsl:apply-templates></xsl:when><xsl:otherwise><xsl:value-of select="$totalwidth + $thiswidth"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="find-entry-start-position"><xsl:choose><!-- if the column number is specified, use it --><xsl:when test="@colnum"><xsl:value-of select="@colnum"/></xsl:when><!-- If there is a defined column name, check the colspans to determine position --><xsl:when test="@colname"><!-- count the number of colspans before the one this entry references, plus one --><xsl:value-of select="number(count(../../../*[contains(@class,' topic/colspec ')][@colname=current()/@colname]/preceding-sibling::*)+1)"/></xsl:when><!-- If the starting column is defined, check colspans to determine position --><xsl:when test="@namest"><xsl:value-of select="number(count(../../../*[contains(@class,' topic/colspec ')][@colname=current()/@namest]/preceding-sibling::*)+1)"/></xsl:when><!-- Need a test for spanspec --><xsl:when test="@spanname"><xsl:variable name="startspan"><!-- starting column for this span --><xsl:value-of select="../../../*[contains(@class,' topic/spanspec ')][@spanname=current()/@spanname]/@namest"/></xsl:variable><xsl:value-of select="number(count(../../../*[contains(@class,' topic/colspec ')][@colname=$startspan]/preceding-sibling::*)+1)"/></xsl:when><!-- Otherwise, just use the count of cells in this row --><xsl:otherwise><xsl:variable name="prev-sib"><xsl:value-of select="count(preceding-sibling::*)"/></xsl:variable><xsl:value-of select="$prev-sib+1"/></xsl:otherwise></xsl:choose></xsl:template>
Template
find-entry-end-position
Documentation
Description
Find the end column of a cell. If the cell does not span any columns,
the end position is the same as the start position.
<xsl:template match="*[contains(@class,' topic/thead ')]/*[contains(@class,' topic/row ')]/*[contains(@class,' topic/entry ')]" mode="findmatch"><xsl:param name="startmatch">1</xsl:param><!-- start column of the tbody cell --><xsl:param name="endmatch">1</xsl:param><!-- end column of the tbody cell --><xsl:variable name="entrystartpos"><!-- start column of this thead cell --><xsl:call-template name="find-entry-start-position"/></xsl:variable><xsl:variable name="entryendpos"><!-- end column of this thead cell --><xsl:call-template name="find-entry-end-position"><xsl:with-param name="startposition" select="$entrystartpos"/></xsl:call-template></xsl:variable><xsl:choose><!-- Ignore this header cell if it starts after the tbody cell we are testing --><xsl:when test="number($endmatch) < number($entrystartpos)"/><!-- Ignore this header cell if it ends before the tbody cell we are testing --><xsl:when test="number($startmatch) > number($entryendpos)"/><!-- Otherwise, this header lines up with the tbody cell, so use the ID --><xsl:otherwise><xsl:value-of select="generate-id(.)"/><xsl:text></xsl:text></xsl:otherwise></xsl:choose></xsl:template>
Check the first column for entries that line up with the test row.
Any entries that line up need to have the header saved. This template is first
called with the first entry of the first row in <tbody>. It is called from here
on the next cell in column one.
Namespace
No namespace
Match
*[contains(@class,' topic/entry ')]
Mode
check-first-column
Parameters
QName
Namespace
Select
endMatchRow
No namespace
1
startCurrentRow
No namespace
1
startMatchRow
No namespace
1
Import precedence
4
Source
<xsl:template match="*[contains(@class,' topic/entry ')]" mode="check-first-column"><xsl:param name="startMatchRow" select="1"/><!-- First row of the tbody cell we are matching --><xsl:param name="endMatchRow" select="1"/><!-- Last row of the tbody cell we are matching --><xsl:param name="startCurrentRow" select="1"/><!-- First row of the column-1 cell we are testing --><xsl:variable name="endCurrentRow"><!-- Last row of the column-1 cell we are testing --><xsl:choose><!-- If @morerows, the cell ends at startCurrentRow + @morerows. Otherise, start=end. --><xsl:when test="@morerows"><xsl:value-of select="number($startCurrentRow)+number(@morerows)"/></xsl:when><xsl:otherwise><xsl:value-of select="$startCurrentRow"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><!-- When the current column-1 cell ends before the tbody cell we are matching --><xsl:when test="number($endCurrentRow) < number($startMatchRow)"><!-- Call this template again with the next entry in column one --><xsl:if test="parent::*/parent::*/*[number($endCurrentRow)+1]"><xsl:apply-templates select="parent::*/parent::*/*[number($endCurrentRow)+1]/*[1]" mode="check-first-column"><xsl:with-param name="startMatchRow" select="$startMatchRow"/><xsl:with-param name="endMatchRow" select="$endMatchRow"/><xsl:with-param name="startCurrentRow" select="number($endCurrentRow)+1"/></xsl:apply-templates></xsl:if></xsl:when><!-- If this column-1 cell starts after the tbody cell we are matching, jump out of recursive loop --><xsl:when test="number($startCurrentRow) > number($endMatchRow)"/><!-- Otherwise, the column-1 cell is aligned with the tbody cell, so save the ID and continue --><xsl:otherwise><xsl:value-of select="generate-id(.)"/><xsl:text></xsl:text><!-- If we are not at the end of the tbody cell, and more rows exist, continue testing column 1 --><xsl:if test="number($endCurrentRow) < number($endMatchRow) and parent::*/parent::*/*[number($endCurrentRow)+1]"><xsl:apply-templates select="parent::*/parent::*/*[number($endCurrentRow)+1]/*[1]" mode="check-first-column"><xsl:with-param name="startMatchRow" select="$startMatchRow"/><xsl:with-param name="endMatchRow" select="$endMatchRow"/><xsl:with-param name="startCurrentRow" select="number($endCurrentRow)+1"/></xsl:apply-templates></xsl:if></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="add-headers-attribute"><!-- Determine the start column for the current cell --><xsl:variable name="entrystartpos"><xsl:call-template name="find-entry-start-position"/></xsl:variable><!-- Determine the end column for the current cell --><xsl:variable name="entryendpos"><xsl:call-template name="find-entry-end-position"><xsl:with-param name="startposition" select="$entrystartpos"/></xsl:call-template></xsl:variable><!-- Find the IDs of headers that are aligned above this cell. This is done by applying
templates on all headers, using mode=findmatch; matching IDs are returned. --><xsl:variable name="hdrattr"><xsl:apply-templates select="../../../*[contains(@class,' topic/thead ')]/*[contains(@class,' topic/row ')]/*" mode="findmatch"><xsl:with-param name="startmatch" select="$entrystartpos"/><xsl:with-param name="endmatch" select="$entryendpos"/></xsl:apply-templates></xsl:variable><!-- Find the IDs of headers in the first column, which are aligned with this cell --><xsl:variable name="rowheader"><!-- If this entry is not in the first column or in thead, and @rowheader=firstcol on table --><xsl:if test="not(number($entrystartpos)=1) and not(parent::*/parent::*[contains(@class,' topic/thead ')]) and ../../../../@rowheader='firstcol'"><!-- Find the start row for this entry --><xsl:variable name="startrow" select="number(count(parent::*/preceding-sibling::*)+1)"/><!-- Find the end row for this entry --><xsl:variable name="endrow"><xsl:if test="@morerows"><xsl:value-of select="number($startrow) + number(@morerows)"/></xsl:if><xsl:if test="not(@morerows)"><xsl:value-of select="$startrow"/></xsl:if></xsl:variable><!-- Scan first-column entries for ones that align with this cell, starting with
the first entry in the first row --><xsl:apply-templates select="../../*[contains(@class,' topic/row ')][1]/*[contains(@class,' topic/entry ')][1]" mode="check-first-column"><xsl:with-param name="startMatchRow" select="$startrow"/><xsl:with-param name="endMatchRow" select="$endrow"/></xsl:apply-templates></xsl:if></xsl:variable><xsl:if test="string-length($rowheader)>0 or string-length($hdrattr)>0"><xsl:attribute name="headers"><xsl:value-of select="$rowheader"/><xsl:value-of select="$hdrattr"/></xsl:attribute></xsl:if></xsl:template>
Template
find-colspan
Documentation
Description
Find the number of column spans between name-start and name-end attrs
<xsl:template match="*[contains(@class,' topic/simpletable ')]" name="topic.simpletable"><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$revtest=1"><!-- Rev is active - add the DIV --><div class="{@rev}"><xsl:apply-templates select="." mode="simpletable-fmt"/></div></xsl:when><xsl:otherwise><!-- Rev wasn't active - process normally --><xsl:apply-templates select="." mode="simpletable-fmt"/></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template match="*[contains(@class,' topic/simpletable ')]" mode="simpletable-fmt"><!-- Find the total number of relative units for the table. If @relcolwidth="1* 2* 2*",
the variable is set to 5. --><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><xsl:variable name="totalwidth"><xsl:if test="@relcolwidth"><xsl:call-template name="find-total-table-width"/></xsl:if></xsl:variable><!-- Find how much of the table each relative unit represents. If @relcolwidth is 1* 2* 2*,
there are 5 units. So, each unit takes up 100/5, or 20% of the table. Default to 0,
which the entries will ignore. --><xsl:variable name="width-multiplier"><xsl:choose><xsl:when test="@relcolwidth"><xsl:value-of select="100 div $totalwidth"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable><xsl:call-template name="spec-title"/><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setaname"/><table cellpadding="4" cellspacing="0" summary=""><xsl:call-template name="setid"/><xsl:choose><xsl:when test="@frame='none'"><xsl:attribute name="border">0</xsl:attribute><xsl:attribute name="class">simpletablenoborder</xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="border">1</xsl:attribute><xsl:attribute name="class">simpletableborder</xsl:attribute></xsl:otherwise></xsl:choose><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="setscale"/><xsl:apply-templates select="." mode="dita2html:simpletable-heading"><xsl:with-param name="width-multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param></xsl:apply-templates><xsl:apply-templates select="*[contains(@class,' topic/strow ')]|processing-instruction()"><!-- width-multiplier will be used in the first row to set widths. --><xsl:with-param name="width-multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param></xsl:apply-templates></table><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*[contains(@class,' topic/strow ')]" name="topic.strow"><xsl:param name="width-multiplier"/><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><tr><xsl:call-template name="setid"/><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:choose><!-- If there are any rows or headers before this, the width values have already been set. --><xsl:when test="preceding-sibling::*"><xsl:apply-templates/></xsl:when><!-- Otherwise, this is the first row. Pass the percentage to all entries in this row. --><xsl:otherwise><xsl:apply-templates><xsl:with-param name="width-multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param></xsl:apply-templates></xsl:otherwise></xsl:choose></tr><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*[contains(@class,' topic/sthead ')]" name="topic.sthead"><xsl:param name="width-multiplier"/><tr><xsl:call-template name="commonattributes"/><!-- There is only one sthead, so use the entries in the header to set relative widths. --><xsl:apply-templates><xsl:with-param name="width-multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param></xsl:apply-templates></tr><xsl:value-of select="$newline"/></xsl:template>
<xsl:template name="output-stentry-id"><!-- Find the position in this row --><xsl:variable name="thiscolnum"><xsl:number level="single" count="*"/></xsl:variable><xsl:choose><xsl:when test="@id"><!-- If ID is specified, always use it --><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute></xsl:when><!-- If no ID is specified, and this is a header cell, generate an ID --><xsl:when test="parent::*[contains(@class,' topic/sthead ')] or (parent::*/parent::*/@keycol and number(parent::*/parent::*/@keycol)=number($thiscolnum))"><xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute></xsl:when></xsl:choose></xsl:template>
<xsl:template name="set.stentry.headers"><xsl:if test="parent::*/parent::*/@keycol | parent::*/parent::*/*[contains(@class,' topic/sthead ')]"><xsl:variable name="thiscolnum"><xsl:number level="single" count="*"/></xsl:variable><!-- If there is a keycol, and this is not the key column, get the ID for the keycol --><xsl:variable name="keycolhead"><xsl:if test="parent::*/parent::*/@keycol and $thiscolnum!=number(parent::*/parent::*/@keycol)"><xsl:choose><xsl:when test="../*[number(parent::*/parent::*/@keycol)]/@id"><xsl:value-of select="../*[number(parent::*/parent::*/@keycol)]/@id"/></xsl:when><xsl:otherwise><xsl:value-of select="generate-id(../*[number(parent::*/parent::*/@keycol)])"/></xsl:otherwise></xsl:choose></xsl:if></xsl:variable><!-- If there is a header, get the ID from the head cell in this column.
Go up to simpletable, into the row, to the entry at column $thiscolnum --><xsl:variable name="header"><xsl:if test="parent::*/parent::*/*[contains(@class,' topic/sthead ')]"><xsl:choose><xsl:when test="parent::*/parent::*/*[contains(@class,' topic/sthead ')]/*[number($thiscolnum)]/@id"><xsl:value-of select="parent::*/parent::*/*[contains(@class,' topic/sthead ')]/*[number($thiscolnum)]/@id"/></xsl:when><xsl:otherwise><xsl:value-of select="generate-id(parent::*/parent::*/*[contains(@class,' topic/sthead ')]/*[number($thiscolnum)])"/></xsl:otherwise></xsl:choose></xsl:if></xsl:variable><!-- If there is a keycol header or an sthead header, create the attribute --><xsl:if test="string-length($header)>0 or string-length($keycolhead)>0"><xsl:attribute name="headers"><xsl:value-of select="$header"/><xsl:if test="string-length($header)>0 and string-length($keycolhead)>0"><xsl:text></xsl:text></xsl:if><xsl:value-of select="$keycolhead"/></xsl:attribute></xsl:if></xsl:if></xsl:template>
Template
*start-stentry-flagging
Documentation
Description
SF Report 2008294: support flagging in simpletable headers. Use common template to simplify
sharing this with all simpletable entries and specializations.
<xsl:template name="topic.sthead_stentry"><xsl:param name="width-multiplier">0</xsl:param><xsl:variable name="flagrules"><xsl:call-template name="getrules"/><xsl:call-template name="getrules-parent"/></xsl:variable><th valign="bottom"><xsl:call-template name="th-align"/><!-- Determine which column this entry is in. --><xsl:variable name="thiscolnum"><xsl:value-of select="number(count(preceding-sibling::*)+1)"/></xsl:variable><!-- If width-multiplier=0, then either @relcolwidth was not specified, or this is not the first
row, so do not create a width value. Otherwise, find out the relative width of this column. --><xsl:variable name="widthpercent"><xsl:if test="$width-multiplier != 0"><xsl:call-template name="get-current-entry-percentage"><xsl:with-param name="multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param><xsl:with-param name="entry-num"><xsl:value-of select="$thiscolnum"/></xsl:with-param></xsl:call-template></xsl:if></xsl:variable><xsl:call-template name="output-stentry-id"/><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><!-- If we calculated a width, create the width attribute. --><xsl:if test="string-length($widthpercent)>0"><xsl:attribute name="width"><xsl:value-of select="$widthpercent"/><xsl:text>%</xsl:text></xsl:attribute></xsl:if><xsl:apply-templates select="." mode="start-stentry-flagging"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:apply-templates><xsl:choose><xsl:when test="not(*|text()|processing-instruction()) and @specentry"><xsl:value-of select="@specentry"/></xsl:when><xsl:otherwise><xsl:apply-templates/></xsl:otherwise></xsl:choose><xsl:apply-templates select="." mode="end-stentry-flagging"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:apply-templates></th><xsl:value-of select="$newline"/></xsl:template>
Template
th-align
Documentation
Description
For simple table headers: <TH> Set align="right" when in a BIDI area
<xsl:template name="topic.strow_stentry"><xsl:param name="width-multiplier">0</xsl:param><xsl:variable name="flagrules"><xsl:call-template name="getrules"/><xsl:call-template name="getrules-parent"/></xsl:variable><td valign="top"><xsl:call-template name="output-stentry-id"/><xsl:call-template name="set.stentry.headers"/><xsl:call-template name="commonattributes"/><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:variable name="localkeycol"><xsl:choose><xsl:when test="ancestor::*[contains(@class,' topic/simpletable ')]/@keycol"><xsl:value-of select="ancestor::*[contains(@class,' topic/simpletable ')]/@keycol"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable><!-- Determine which column this entry is in. --><xsl:variable name="thiscolnum"><xsl:value-of select="number(count(preceding-sibling::*)+1)"/></xsl:variable><!-- If width-multiplier=0, then either @relcolwidth was not specified, or this is not the first
row, so do not create a width value. Otherwise, find out the relative width of this column. --><xsl:variable name="widthpercent"><xsl:if test="$width-multiplier != 0"><xsl:call-template name="get-current-entry-percentage"><xsl:with-param name="multiplier"><xsl:value-of select="$width-multiplier"/></xsl:with-param><xsl:with-param name="entry-num"><xsl:value-of select="$thiscolnum"/></xsl:with-param></xsl:call-template></xsl:if></xsl:variable><!-- If we calculated a width, create the width attribute. --><xsl:if test="string-length($widthpercent)>0"><xsl:attribute name="width"><xsl:value-of select="$widthpercent"/><xsl:text>%</xsl:text></xsl:attribute></xsl:if><xsl:apply-templates select="." mode="start-stentry-flagging"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:apply-templates><xsl:variable name="revtest"><xsl:if test="@rev and not($FILTERFILE='') and ($DRAFT='yes')"><!-- revision? --><xsl:call-template name="find-active-rev-flag"><!-- active? (revtest will be 1 when active)--><xsl:with-param name="allrevs" select="@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:variable name="revtest-row"><xsl:if test="../@rev and not($FILTERFILE='') and ($DRAFT='yes')"><!-- revision? --><xsl:call-template name="find-active-rev-flag"><!-- active? (revtest will be 1 when active)--><xsl:with-param name="allrevs" select="../@rev"/></xsl:call-template></xsl:if></xsl:variable><xsl:choose><xsl:when test="$thiscolnum=$localkeycol and $revtest-row=1"><strong><span class="{../@rev}"><xsl:call-template name="stentry-templates"/></span></strong></xsl:when><xsl:when test="$thiscolnum=$localkeycol and $revtest=1"><strong><span class="{@rev}"><xsl:call-template name="stentry-templates"/></span></strong></xsl:when><xsl:when test="$thiscolnum=$localkeycol"><strong><xsl:call-template name="stentry-templates"/></strong></xsl:when><xsl:when test="$revtest-row=1"><span class="{../@rev}"><xsl:call-template name="stentry-templates"/></span></xsl:when><xsl:when test="$revtest=1"><span class="{@rev}"><xsl:call-template name="stentry-templates"/></span></xsl:when><xsl:otherwise><xsl:call-template name="stentry-templates"/></xsl:otherwise></xsl:choose><xsl:apply-templates select="." mode="end-stentry-flagging"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:apply-templates></td><xsl:value-of select="$newline"/></xsl:template>
<xsl:template name="find-total-table-width"><!-- Start with relcolwidth, and each recursive call will remove the first value --><xsl:param name="relcolwidth"><xsl:value-of select="@relcolwidth"/></xsl:param><!-- Determine the first value, which is the value before the first asterisk --><xsl:variable name="firstval"><xsl:if test="contains($relcolwidth,'*')"><xsl:value-of select="substring-before($relcolwidth,'*')"/></xsl:if></xsl:variable><!-- Begin processing if we were able to find a first value --><xsl:if test="string-length($firstval)>0"><!-- Chop off the first value, and set morevals to the remainder --><xsl:variable name="morevals"><xsl:value-of select="substring-after($relcolwidth,' ')"/></xsl:variable><xsl:choose><!-- If there are additional values, call this template on the remainder.
Add the result of that call to the first value. --><xsl:when test="string-length($morevals)>0"><xsl:variable name="nextval"><!-- The total of the remaining values --><xsl:call-template name="find-total-table-width"><xsl:with-param name="relcolwidth"><xsl:value-of select="$morevals"/></xsl:with-param></xsl:call-template></xsl:variable><xsl:value-of select="number($firstval)+number($nextval)"/></xsl:when><!-- If there are no more values, return the first (and only) value --><xsl:otherwise><xsl:value-of select="$firstval"/></xsl:otherwise></xsl:choose></xsl:if></xsl:template>
Template
get-current-entry-percentage
Documentation
Description
Find the width of the current cell. Multiplier is how much each unit of width is multiplied to total 100.
Entry-num is the current entry. Current-col is what column we are at when scanning @relcolwidth.
Relcolvalues is the unscanned part of @relcolwidth.
<xsl:template name="get-current-entry-percentage"><xsl:param name="multiplier">1</xsl:param><!-- Each relative unit is worth this many percentage points --><xsl:param name="entry-num"/><!-- The entry number of the cell we are evaluating now --><xsl:param name="current-col">1</xsl:param><!-- Position within the recursive call to evaluate @relcolwidth --><!-- relcolvalues begins with @relcolwidth. Each call to the template removes the first value. --><xsl:param name="relcolvalues"><xsl:value-of select="parent::*/parent::*/@relcolwidth"/></xsl:param><xsl:choose><!-- If the recursion has moved up to the proper cell, multiply $multiplier by the number of
relative units for this column. --><xsl:when test="$entry-num = $current-col"><xsl:variable name="relcol"><xsl:value-of select="substring-before($relcolvalues,'*')"/></xsl:variable><xsl:value-of select="$relcol * $multiplier"/></xsl:when><!-- Otherwise, call this template again, removing the first value form @relcolwidth. Also add one
to $current-col. --><xsl:otherwise><xsl:call-template name="get-current-entry-percentage"><xsl:with-param name="multiplier"><xsl:value-of select="$multiplier"/></xsl:with-param><xsl:with-param name="entry-num"><xsl:value-of select="$entry-num"/></xsl:with-param><xsl:with-param name="current-col"><xsl:value-of select="$current-col + 1"/></xsl:with-param><xsl:with-param name="relcolvalues"><xsl:value-of select="substring-after($relcolvalues,' ')"/></xsl:with-param></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template>
Template
*[contains(@class,' topic/fn ')]topic.fn
Documentation
Description
=========== FOOTNOTE ===========
Namespace
No namespace
Match
*[contains(@class,' topic/fn ')]
Mode
#default
Parameters
QName
Namespace
xref
No namespace
Import precedence
4
Source
<xsl:template match="*[contains(@class,' topic/fn ')]" name="topic.fn"><xsl:param name="xref"/><!-- when FN has an ID, it can only be referenced, otherwise, output an a-name & a counter --><xsl:if test="not(@id) or $xref='yes'"><xsl:variable name="fnid"><xsl:number from="/" level="any"/></xsl:variable><xsl:variable name="callout"><xsl:value-of select="@callout"/></xsl:variable><xsl:variable name="convergedcallout"><xsl:choose><xsl:when test="string-length($callout)>'0'"><xsl:value-of select="$callout"/></xsl:when><xsl:otherwise><xsl:value-of select="$fnid"/></xsl:otherwise></xsl:choose></xsl:variable><a name="fnsrc_{$fnid}" href="#fntarg_{$fnid}"><sup><xsl:value-of select="$convergedcallout"/></sup></a></xsl:if></xsl:template>
<xsl:template name="setidattr"><xsl:param name="idvalue"/><xsl:attribute name="id"><!-- If we're in the body, prefix the ID with the topic's ID & two "_" --><xsl:if test="ancestor::*[contains(@class,' topic/body ')]"><xsl:value-of select="ancestor::*[contains(@class,' topic/body ')]/parent::*/@id"/><xsl:text>__</xsl:text></xsl:if><xsl:value-of select="$idvalue"/></xsl:attribute></xsl:template>
<xsl:template name="parent-id"><!-- if the parent's element has an ID, copy it through as an anchor --><a><xsl:attribute name="name"><xsl:if test="ancestor::*[contains(@class,' topic/body ')]"><xsl:value-of select="ancestor::*[contains(@class,' topic/body ')]/parent::*/@id"/><xsl:text>__</xsl:text></xsl:if><xsl:value-of select="parent::*/@id"/></xsl:attribute><xsl:value-of select="$afill"/><xsl:comment><xsl:text></xsl:text></xsl:comment><!-- fix for home page reader --></a></xsl:template>
Template
gen-toc-id
Documentation
Description
Create & insert an ID for the generated table of contents
Set the class attribute on the resulting output element. The default for a class of elements
may be passed in with $default, but that default can be overridden with mode="get-output-class".
<xsl:template match="*" mode="get-element-ancestry"><xsl:param name="checkclass" select="@class"/><xsl:if test="contains($checkclass,'/')"><xsl:variable name="lastpair"><xsl:call-template name="get-last-class-pair"><xsl:with-param name="checkclass" select="$checkclass"/></xsl:call-template></xsl:variable><!-- If there are any module/element pairs before the last one, process them and add a space --><xsl:if test="contains(substring-before($checkclass,$lastpair),'/')"><xsl:apply-templates select="." mode="get-element-ancestry"><xsl:with-param name="checkclass" select="substring-before($checkclass,$lastpair)"/></xsl:apply-templates><xsl:text></xsl:text></xsl:if><xsl:value-of select="substring-after($lastpair,'/')"/></xsl:if></xsl:template>
Template
get-last-class-pair
Documentation
Description
Find the last module/element pair in a class string
if the element has a compact=yes attribute, assert it in XHTML form
Namespace
No namespace
Match
@compact
Mode
#default
Import precedence
4
Source
<xsl:template match="@compact"><xsl:if test=". = 'yes'"><xsl:attribute name="compact">compact</xsl:attribute><!-- assumes that no compaction is default --></xsl:if></xsl:template>
=========== CONREF (content fetched by id from conrefed element) ===========
conref processing is now done in the first stage & conref.xsl
========== JAVASCRIPT SUPPORT ==========
Namespace
No namespace
Import precedence
4
Source
<xsl:template name="script-sample"><script language="JavaScript"><xsl:comment>
// define JavaScript within here; use CDATA sections as appropriate
self.focus();
function popwin(popupitem)
{
var PopUpWin=window.open(popupitem,"PopUpWin","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=500,height=200");
PopUpWin.focus();
}
//</xsl:comment></script></xsl:template>
Template
spec-title
Documentation
Description
========= NAMED TEMPLATES (call by name, only) ==========
named templates that can be used anywhere
Process spectitle attribute - if one exists - needs to be called on tags that allow it
<xsl:template name="spec-title-cell"><!-- not used - was a cell 'title' --><xsl:if test="@specentry"><xsl:value-of select="@specentry"/><xsl:text></xsl:text></xsl:if></xsl:template>
<xsl:template name="br-replace"><xsl:param name="brtext"/><!-- capture an actual newline within the xsl:text element --><xsl:variable name="cr"><xsl:text></xsl:text></xsl:variable><xsl:choose><xsl:when test="contains($brtext,$cr)"><xsl:value-of select="substring-before($brtext,$cr)"/><br/><xsl:value-of select="$cr"/><xsl:call-template name="br-replace"><!-- call again to get remaining CRs --><xsl:with-param name="brtext" select="substring-after($brtext,$cr)"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$brtext"/><!-- No CRs, just output --></xsl:otherwise></xsl:choose></xsl:template>
Template
sp-replace
Documentation
Description
Space replace - used for LINES
add checks for repeating leading blanks & converts them to
this replaces newlines with the BR element. Forces breaks.
<xsl:template name="sect-heading"><xsl:param name="defaulttitle"/><!-- get param by reference --><!-- Deprecated in favor of the mode template --><xsl:apply-templates select="." mode="dita2html:section-heading"><xsl:with-param name="defaulttitle" select="$defaulttitle"/></xsl:apply-templates></xsl:template>
<xsl:template name="gen-endnotes"><!-- Skip any footnotes that are in draft elements when draft = no --><xsl:apply-templates select="//*[contains(@class,' topic/fn ')][not( (ancestor::*[contains(@class,' topic/draft-comment ')] or ancestor::*[contains(@class,' topic/required-cleanup ')]) and $DRAFT='no')]" mode="genEndnote"/></xsl:template>
| These macros support globally-defined formatting constants for
| document content. Some elements have attributes that permit local
| control of formatting; such logic is part of the pertinent template rule.
+
Namespace
No namespace
Import precedence
4
Source
<xsl:template name="place-tbl-width"><!-- was 540 now 100% --><xsl:variable name="twidth-fixed">100%</xsl:variable><xsl:if test="$twidth-fixed != ''"><xsl:attribute name="width"><xsl:value-of select="$twidth-fixed"/></xsl:attribute></xsl:if></xsl:template>
<xsl:template name="proc-ing"><xsl:if test="$do-place-ing = 'yes'"><!-- set in a global variable, as with label placement, etc. --><img src="tip-ing.jpg" alt="tip-ing.jpg"/><!-- this should be an xsl:choose with the approved list and a selection method--><!-- add any other required positioning controls, if needed, but must be valid in the location
from which the call to this template was made --><xsl:text disable-output-escaping="yes"> </xsl:text></xsl:if></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-head"><!-- to customize: copy this to your override transform, add the content you want. --><!-- it will be placed in the HEAD section of the XHTML. --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-header"><!-- to customize: copy this to your override transform, add the content you want. --><!-- it will be placed in the running heading section of the XHTML. --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-sidetoc"><!-- to customize: copy this to your override transform, add the content you want. --><!-- Uncomment the line below to have a "freebie" table of contents on the top-right --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-scripts"><!-- to customize: copy this to your override transform, add the content you want. --><!-- It will be placed before the ending HEAD tag --><!-- see (or enable) the named template "script-sample" for an example --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-styles"><!-- to customize: copy this to your override transform, add the content you want. --><!-- It will be placed before the ending HEAD tag --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-external-link"><!-- to customize: copy this to your override transform, add the content you want. --><!-- It will be placed after an external LINK or XREF --></xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-panel-title-pfx"><!-- to customize: copy this to your override transform, add the content you want. --><!-- It will be placed immediately after TITLE tag, in the title --></xsl:template>
<xsl:template match="*" mode="chapterHead"><head><xsl:value-of select="$newline"/><!-- initial meta information --><xsl:call-template name="generateCharset"/><!-- Set the character set to UTF-8 --><xsl:call-template name="generateDefaultCopyright"/><!-- Generate a default copyright, if needed --><xsl:call-template name="generateDefaultMeta"/><!-- Standard meta for security, robots, etc --><xsl:call-template name="getMeta"/><!-- Process metadata from topic prolog --><xsl:call-template name="copyright"/><!-- Generate copyright, if specified manually --><xsl:call-template name="generateCssLinks"/><!-- Generate links to CSS files --><xsl:call-template name="generateChapterTitle"/><!-- Generate the <title> element --><xsl:call-template name="gen-user-head"/><!-- include user's XSL HEAD processing here --><xsl:call-template name="gen-user-scripts"/><!-- include user's XSL javascripts here --><xsl:call-template name="gen-user-styles"/><!-- include user's XSL style element and content here --><xsl:call-template name="processHDF"/><!-- Add user HDF file, if specified --></head><xsl:value-of select="$newline"/></xsl:template>
<xsl:template name="generateDefaultMeta"><xsl:if test="$genDefMeta='yes'"><meta name="security" content="public"/><xsl:value-of select="$newline"/><meta name="Robots" content="index,follow"/><xsl:value-of select="$newline"/><xsl:text disable-output-escaping="yes"><meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /></xsl:text><xsl:value-of select="$newline"/></xsl:if></xsl:template>
<xsl:template name="generateChapterTitle"><!-- Title processing - special handling for short descriptions --><title><xsl:call-template name="gen-user-panel-title-pfx"/><!-- hook for a user-XSL title prefix --><!-- use the searchtitle unless there's no value - else use title --><xsl:variable name="schtitle"><xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/></xsl:variable><xsl:variable name="ditaschtitle"><xsl:value-of select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/></xsl:variable><xsl:variable name="maintitle"><xsl:apply-templates select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" mode="text-only"/></xsl:variable><xsl:variable name="ditamaintitle"><xsl:apply-templates select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/title ')]" mode="text-only"/></xsl:variable><!-- edited by William on 2009-05-18 for searchtitle bug start --><xsl:variable name="mapschtitle"><xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' map/searchtitle ')]"/></xsl:variable><!-- edited by William on 2009-05-18 for searchtitile bug end --><xsl:choose><xsl:when test="string-length($schtitle)>'0'"><xsl:value-of select="normalize-space($schtitle)"/></xsl:when><!-- edited by William on 2009-05-18 for searchtitle bug start --><xsl:when test="string-length($mapschtitle)>'0'"><xsl:value-of select="normalize-space($mapschtitle)"/></xsl:when><!-- edited by William on 2009-05-18 for searchtitile bug end --><xsl:when test="string-length($ditaschtitle)>'0'"><xsl:value-of select="normalize-space($ditaschtitle)"/></xsl:when><xsl:when test="string-length($maintitle)>'0'"><xsl:value-of select="normalize-space($maintitle)"/></xsl:when><xsl:when test="string-length($ditamaintitle)>'0'"><xsl:value-of select="normalize-space($ditamaintitle)"/></xsl:when><xsl:otherwise><xsl:text>***</xsl:text><xsl:apply-templates select="." mode="ditamsg:no-title-for-topic"/></xsl:otherwise></xsl:choose></title><xsl:value-of select="$newline"/></xsl:template>
<xsl:template match="*" mode="chapterBody"><xsl:variable name="flagrules"><xsl:call-template name="getrules"/></xsl:variable><body><!-- Already put xml:lang on <html>; do not copy to body with commonattributes --><xsl:call-template name="gen-style"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><!--output parent or first "topic" tag's outputclass as class --><xsl:if test="@outputclass"><xsl:attribute name="class"><xsl:value-of select="@outputclass"/></xsl:attribute></xsl:if><xsl:if test="self::dita"><xsl:if test="*[contains(@class,' topic/topic ')][1]/@outputclass"><xsl:attribute name="class"><xsl:value-of select="*[contains(@class,' topic/topic ')][1]/@outputclass"/></xsl:attribute></xsl:if></xsl:if><xsl:apply-templates select="." mode="addAttributesToBody"/><xsl:call-template name="setidaname"/><xsl:value-of select="$newline"/><xsl:call-template name="start-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="start-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="generateBreadcrumbs"/><xsl:call-template name="gen-user-header"/><!-- include user's XSL running header here --><xsl:call-template name="processHDR"/><!-- Include a user's XSL call here to generate a toc based on what's a child of topic --><xsl:call-template name="gen-user-sidetoc"/><xsl:apply-templates/><!-- this will include all things within topic; therefore, --><!-- title content will appear here by fall-through --><!-- followed by prolog (but no fall-through is permitted for it) --><!-- followed by body content, again by fall-through in document order --><!-- followed by related links --><!-- followed by child topics by fall-through --><xsl:call-template name="gen-endnotes"/><!-- include footnote-endnotes --><xsl:call-template name="gen-user-footer"/><!-- include user's XSL running footer here --><xsl:call-template name="processFTR"/><!-- Include XHTML footer, if specified --><xsl:call-template name="end-revflag"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template><xsl:call-template name="end-flagit"><xsl:with-param name="flagrules" select="$flagrules"/></xsl:call-template></body><xsl:value-of select="$newline"/></xsl:template>
Template
*addAttributesToBody
Documentation
Description
Override this template to add any standard attributes to
the HTML <body> element. Current context is the root
element of the doc.
<xsl:template name="generateBreadcrumbs"><!-- Insert previous/next/ancestor breadcrumbs links at the top of the xhtml. --><xsl:apply-templates select="*[contains(@class,' topic/related-links ')]" mode="breadcrumb"/></xsl:template>
<xsl:template name="get-path2project"><!-- Deal with being handed a Windows backslashed path by accident. --><!-- This code only changes \ to / and doesn't handle the many other situations
where a URI differs from a file path. Hopefully they don't occur in path2proj anyway. --><xsl:param name="s"/><xsl:choose><xsl:when test="contains($s, '\')"><xsl:value-of select="substring-before($s, '\')"/><xsl:text>/</xsl:text><xsl:call-template name="get-path2project"><xsl:with-param name="s" select="substring-after($s, '\')"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:value-of select="$s"/></xsl:otherwise></xsl:choose></xsl:template>
the working directory that contains the document being transformed.
Needed as a directory prefix for the @conref "document()" function calls.
default is '../doc/')