Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


boolean predicate in variable?

From: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= <cometaj@-------.--->
To: NULL
Date: 5/4/2007 8:22:00 AM

Hello guys,

I was wondering if it was possible to reference a boolean predicate in
a variable. Basically I want to do with the boolean predicate what you
would do with any other variable; I want it to apply to many places
without having to update all those different locations if the
predicate needs to change.

This is not a full stylesheet, just snippets of the idea

  <xsl:variable name="list-orphans-widows.properties">
    position()=last()-1 or position()=last()-2 or (position()='1' and
position()!=last()) or (position()='2' and position()!=last())
  </xsl:variable>

  <xsl:template match="ListB | CELLListB">
    <fo:list-block padding-after="12pt">

      <xsl:variable name="ListBItemsRTF">
        <ListB>
          <xsl:copy-of select="@*"/>
          <xsl:for-each select="ListBItem | CELLListB">
            <xsl:choose>
              <xsl:when test="$list-orphans-widows.properties">
                <xsl:copy>
                  <xsl:copy-of select="@*"/>
                  <xsl:attribute name="keep-with-next">always</
xsl:attribute>
                  <xsl:apply-templates/>
                </xsl:copy>
              </xsl:when>
              <xsl:otherwise>
                <xsl:copy-of select="."/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:for-each>
        </ListB>
      </xsl:variable>

      <xsl:for-each select="exsl:node-set($ListBItemsRTF)">
        <xsl:apply-templates select="//ListBItem | //CELLListBItem"/>
      </xsl:for-each>

    </fo:list-block>
  </xsl:template>

It works cleanly when the predicate is straight up in test="", but the
predicate yields true in all cases when I try to reference the
variable. Is what I'm trying to do possible in XSLT?

Regards
Jean-Francois Michaud



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent