locked
XSLT When Statement - HELP RRS feed

  • Question

  • User-666661156 posted

    Hey Everyone, 

    I'm new to XSLT Stylesheets and am trying to navigate around an existing stylesheet. I need to remove an existing when clause so that the contents within the when statement always show on every form. Currently it's conditional, so I'm trying to remove the condition and have it always show, what would be the best way to achieve this? 

    Here's the conditional statement: 

       <xsl:when test="not(/Form/FormType = 'EBIT') and count(Charge/EBITCharge[DeletedFlag = 'No']) > 0">
                  <xsl:text>FORM INFORMATION:</xsl:text>
                  <xsl:text>&#xa;</xsl:text>
                  <xsl:text>&#xa;</xsl:text>
                  <xsl:text>NUMBER: </xsl:text>
                  <xsl:value-of select="translate(Charge/EBITCharge[DeletedFlag = 'No']/Case, $smallcase, $uppercase)"/>
                  <xsl:text>&#xa;</xsl:text>
                  <xsl:text>PROGRAM OFFICE: </xsl:text>
                  <xsl:variable name="Agy" select="Charge/EBITCharge[DeletedFlag = 'No']/AgencyIDNumber"/>
                  <xsl:call-template name="selectSetLen">
                    <xsl:with-param name="value" select="//Agency[AgencyIDNumber = $Agy]/AgencyID" />
                    <xsl:with-param name="length" select="11"/>
                  </xsl:call-template>
                  <xsl:value-of select="translate(//Agency[AgencyIDNumber = $Agy]/AgencyName, $smallcase, $uppercase)"/>
                  <xsl:text>&#xa;</xsl:text>
                  <xsl:text>&#xa;</xsl:text>
                  <xsl:call-template name="spaces">
                    <xsl:with-param name="count" select="6"/>
                  </xsl:call-template>
                  <xsl:text>PROGRAM NOT ACTIVE</xsl:text>
                  <xsl:text>&#xa;</xsl:text>
                </xsl:when>

    Appreciate any help I can get on this, thanks! 

    Monday, June 24, 2019 2:14 PM

All replies

  • User-2010311731 posted

    You should be able to just remove the <xsl:when …> and </xsl:when> (the first and last lines).

    Monday, June 24, 2019 7:57 PM