<xsl:template name="addPropertiesHeadersAttribute"><xsl:param name="classVal"/><xsl:param name="elementType"/><xsl:attribute name="headers"><xsl:choose><!-- First choice: if there is a matching cell inside a user-specified header, and it has an ID --><xsl:when test="ancestor::*[contains(@class,' reference/properties ')]/*[1][contains(@class,' reference/prophead ')]/*[contains(@class,$classVal)]/@id"><xsl:value-of select="ancestor::*[contains(@class,' reference/properties ')]/*[1][contains(@class,' reference/prophead ')]/*[contains(@class,$classVal)]/@id"/></xsl:when><!-- Second choice: if there is a matching cell inside a user-specified header, use its generated ID --><xsl:when test="ancestor::*[contains(@class,' reference/properties ')]/*[1][contains(@class,' reference/prophead ')]/*[contains(@class,$classVal)]"><xsl:value-of select="generate-id(ancestor::*[contains(@class,' reference/properties ')]/*[1][contains(@class,' reference/prophead ')]/*[contains(@class,$classVal)])"/></xsl:when><!-- Third choice: no user-specified header for this column. ID is based on the table's generated ID. --><xsl:otherwise><xsl:value-of select="generate-id(ancestor::*[contains(@class,' reference/properties ')])"/>-<xsl:value-of select="$elementType"/></xsl:otherwise></xsl:choose></xsl:attribute></xsl:template>
Process a standard row in the properties table. Apply-templates on the entries one at a time;
if one is missing which should be present, create an empty cell.
Template based on the stentry template in dit2htm. Only change is to add elementType
paramenter, and call addPropertiesHeadersAttribute instead of output-stentry-headers.
<xsl:template match="*" mode="propertiesEntry"><xsl:param name="width-multiplier">0</xsl:param><xsl:param name="elementType"/><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="addPropertiesHeadersAttribute"><xsl:with-param name="classVal"> reference/prop<xsl:value-of select="$elementType"/>hd<xsl:text></xsl:text></xsl:with-param><xsl:with-param name="elementType"><xsl:value-of select="$elementType"/></xsl:with-param></xsl:call-template><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')"><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="$thiscolnum=$localkeycol and $revtest-row=1"><strong><span class="{../@rev}"><xsl:call-template name="propentry-templates"/></span></strong></xsl:when><xsl:when test="$thiscolnum=$localkeycol and $revtest=1"><strong><span class="{@rev}"><xsl:call-template name="propentry-templates"/></span></strong></xsl:when><xsl:when test="$thiscolnum=$localkeycol"><strong><xsl:call-template name="propentry-templates"/></strong></xsl:when><xsl:when test="$revtest-row=1"><span class="{../@rev}"><xsl:call-template name="propentry-templates"/></span></xsl:when><xsl:when test="$revtest=1"><span class="{@rev}"><xsl:call-template name="propentry-templates"/></span></xsl:when><xsl:otherwise><xsl:call-template name="propentry-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>