========== Flagging with flags & revisions ==========
Flags - based on audience, product, platform, and otherprops in the source
AND prop elements in the val file:
Flag the text with the artwork from the val file & insert the ALT text from the val file.
For multiple attr values, output each flag in turn.
<xsl:template name="flagit-parent"><xsl:variable name="domains"><xsl:value-of select="normalize-space(ancestor::*[contains(@class,' topic/topic ')][1]/@domains)"/></xsl:variable><xsl:variable name="props"><xsl:if test="contains($domains, 'a(props')"><xsl:value-of select="normalize-space(substring-before(substring-after($domains,'a(props'), ')'))"/></xsl:if></xsl:variable><!-- Test for the flagging attributes on the parent.
If found and if the filterfile name was passed in,
call 'mark-prop' with the values to use. Otherwise return --><xsl:if test="../@audience and not($FILTERFILE='')"><xsl:call-template name="mark-prop"><xsl:with-param name="flag-att" select="'audience'"/><xsl:with-param name="flag-att-val" select="../@audience"/></xsl:call-template></xsl:if><xsl:if test="../@platform and not($FILTERFILE='')"><xsl:call-template name="mark-prop"><xsl:with-param name="flag-att" select="'platform'"/><xsl:with-param name="flag-att-val" select="../@platform"/></xsl:call-template></xsl:if><xsl:if test="../@product and not($FILTERFILE='')"><xsl:call-template name="mark-prop"><xsl:with-param name="flag-att" select="'product'"/><xsl:with-param name="flag-att-val" select="../@product"/></xsl:call-template></xsl:if><xsl:if test="../@otherprops and not($FILTERFILE='')"><xsl:call-template name="mark-prop"><xsl:with-param name="flag-att" select="'otherprops'"/><xsl:with-param name="flag-att-val" select="../@otherprops"/></xsl:call-template></xsl:if><xsl:if test="not($props='') and not($FILTERFILE='')"><xsl:call-template name="ext-flagit-parent"><xsl:with-param name="props" select="$props"/></xsl:call-template></xsl:if></xsl:template>
<xsl:template name="mark-prop"><xsl:param name="flag-att"/><!-- attribute name --><xsl:param name="flag-att-val"/><!-- content of attribute --><!-- Determine the first flag value, which is the value before the first space --><xsl:variable name="firstflag"><xsl:choose><xsl:when test="contains($flag-att-val,' ')"><xsl:value-of select="substring-before($flag-att-val,' ')"/></xsl:when><xsl:otherwise><!-- no space, one value --><xsl:value-of select="$flag-att-val"/></xsl:otherwise></xsl:choose></xsl:variable><!-- Determine the other flag values, after the first space --><xsl:variable name="moreflags"><xsl:choose><xsl:when test="contains($flag-att-val,' ')"><xsl:value-of select="substring-after($flag-att-val,' ')"/></xsl:when><xsl:otherwise/><!-- no space, one value --></xsl:choose></xsl:variable><xsl:choose><!-- Ensure there's an image to get, otherwise don't insert anything --><xsl:when test="$FILTERDOC/val/prop[@att=$flag-att][@val=$firstflag][@action='flag'][@img]"><!-- output the flag --><xsl:variable name="imgsrc" select="$FILTERDOC/val/prop[@att=$flag-att][@val=$firstflag][@action='flag']/@img"/><img><xsl:attribute name="src"><xsl:if test="string-length($PATH2PROJ) > 0"><xsl:value-of select="$PATH2PROJ"/></xsl:if><!--
<xsl:call-template name="get-file-name">
<xsl:with-param name="file-path" select="$imgsrc"/>
</xsl:call-template>
--><xsl:value-of select="$imgsrc"/></xsl:attribute><xsl:attribute name="alt"><!-- always insert an ALT - if it's blank, assume the user didn't want to fill it. --><xsl:value-of select="$FILTERDOC/val/prop[@att=$flag-att][@val=$firstflag][@action='flag']/@alt"/></xsl:attribute></img></xsl:when><xsl:otherwise/><!-- that flag not active --></xsl:choose><!-- keep testing other values --><xsl:choose><xsl:when test="string-length($moreflags)>0"><!-- more values - call it again with remaining values --><xsl:call-template name="mark-prop"><xsl:with-param name="flag-att"><xsl:value-of select="$flag-att"/></xsl:with-param><xsl:with-param name="flag-att-val"><xsl:value-of select="$moreflags"/></xsl:with-param></xsl:call-template></xsl:when><xsl:otherwise/><!-- no more values --></xsl:choose></xsl:template>
<xsl:template name="start-revflag-parent"><xsl:if test="../@rev and not(@rev) and not($FILTERFILE='')"><xsl:call-template name="start-mark-rev"><xsl:with-param name="revvalue" select="../@rev"/></xsl:call-template></xsl:if></xsl:template>
<xsl:template name="end-revflag-parent"><xsl:if test="../@rev and not(@rev) and not($FILTERFILE='')"><xsl:call-template name="end-mark-rev"><xsl:with-param name="revvalue" select="../@rev"/></xsl:call-template></xsl:if></xsl:template>
Template
revblock-deprecated
Documentation
Description
Output starting & ending flag for "blocked" text.
Use instead of 'apply-templates' for block areas (P, Note, DD, etc)
<xsl:template name="revstyle-deprecated"><xsl:param name="revvalue"/><xsl:variable name="revcolor"><xsl:call-template name="find-active-rev-style"><!-- get 1st active rev color --><xsl:with-param name="allrevs" select="$revvalue"/></xsl:call-template></xsl:variable><xsl:choose><xsl:when test="string-length($revcolor)>0"><!-- if there's a value, there's an active color --><font><xsl:attribute name="color"><xsl:value-of select="$revcolor"/></xsl:attribute><xsl:apply-templates/></font></xsl:when><xsl:otherwise><xsl:apply-templates/><!-- no active rev color - just apply templates --></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="start-revision-flag-deprecated"><xsl:variable name="biditest"><xsl:call-template name="bidi-area"/></xsl:variable><xsl:choose><xsl:when test="$biditest='bidi'"><xsl:call-template name="start-rev-art"><!-- BIDI, use English end graphic for start of change--><xsl:with-param name="deltaname" select="'deltaend.gif'"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="start-rev-art"><!-- Not BIDI, use English start graphic --><xsl:with-param name="deltaname" select="'delta.gif'"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="end-revision-flag-deprecated"><xsl:variable name="biditest"><xsl:call-template name="bidi-area"/></xsl:variable><xsl:choose><xsl:when test="$biditest='bidi'"><xsl:call-template name="end-rev-art"><!-- BIDI, use English start graphic for end of change--><xsl:with-param name="deltaname" select="'delta.gif'"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="end-rev-art"><!-- Not BIDI, use English end graphic --><xsl:with-param name="deltaname" select="'deltaend.gif'"/></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template>
<xsl:template name="find-active-rev-flag"><xsl:param name="allrevs"/><!-- Determine the first rev value, which is the value before the first space --><xsl:variable name="firstrev"><xsl:choose><xsl:when test="contains($allrevs,' ')"><xsl:value-of select="substring-before($allrevs,' ')"/></xsl:when><xsl:otherwise><!-- no space, one value --><xsl:value-of select="$allrevs"/></xsl:otherwise></xsl:choose></xsl:variable><!-- Determine the other rev value, after the first space --><xsl:variable name="morerevs"><xsl:choose><xsl:when test="contains($allrevs,' ')"><xsl:value-of select="substring-after($allrevs,' ')"/></xsl:when><xsl:otherwise/><!-- no space, one value --></xsl:choose></xsl:variable><xsl:choose><xsl:when test="$FILTERDOC/val/revprop[@val=$firstrev][@action='flag']"><xsl:value-of select="1"/><!-- rev active --></xsl:when><xsl:otherwise><!-- rev not active --><!-- keep testing other values --><xsl:choose><xsl:when test="string-length($morerevs)>0"><!-- more values - call it again with remaining values --><xsl:call-template name="find-active-rev-flag"><xsl:with-param name="allrevs"><xsl:value-of select="$morerevs"/></xsl:with-param></xsl:call-template></xsl:when><xsl:otherwise><!-- no more values - none found --><xsl:value-of select="0"/></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:template>
Template
find-active-rev-style
Documentation
Description
Use @rev to find the first active styled revision.
Return color setting when active.
Return null for non-active.
<xsl:template name="find-active-rev-style"><xsl:param name="allrevs"/><!-- Determine the first rev value, which is the value before the first space --><xsl:variable name="firstrev"><xsl:choose><xsl:when test="contains($allrevs,' ')"><xsl:value-of select="substring-before($allrevs,' ')"/></xsl:when><xsl:otherwise><!-- no space, one value --><xsl:value-of select="$allrevs"/></xsl:otherwise></xsl:choose></xsl:variable><!-- Determine the other rev value, after the first space --><xsl:variable name="morerevs"><xsl:choose><xsl:when test="contains($allrevs,' ')"><xsl:value-of select="substring-after($allrevs,' ')"/></xsl:when><xsl:otherwise/><!-- no space, one value --></xsl:choose></xsl:variable><xsl:choose><xsl:when test="$FILTERDOC/val/revprop[@val=$firstrev]/@style"><!-- rev active --><xsl:value-of select="$FILTERDOC/val/revprop[@val=$firstrev]/@style"/></xsl:when><xsl:otherwise><!-- rev not active --><!-- keep testing other values --><xsl:choose><xsl:when test="string-length($morerevs)>0"><!-- more values - call it again with remaining values --><xsl:call-template name="find-active-rev-style"><xsl:with-param name="allrevs"><xsl:value-of select="$morerevs"/></xsl:with-param></xsl:call-template></xsl:when><xsl:otherwise/><!-- no more values - none found --></xsl:choose></xsl:otherwise></xsl:choose></xsl:template>