JohnnyOffTheSpot
asked on
Need XSL code to skip output if a condition is met in a tag, again.
Gertone answered this question previously with the attached code.
This code has worked wonders for those tags that are empty or have differing amounts of characters in them.
I have finally stumbled upon a tag that will contain either an X or an N. If it contains an X, that I have to skip that line from being printed.
I have tried variations of the following:
<xsl:if test="contains(normalize-s pace(Rtype 01), X)">
and
<xsl:if test="match(normalize-spac e(RateType MinBill), X)">
Even if I get past the syntax errors, it just prints my line regardless.
I think what I need to do is say something like, if test="match..... then call the normalize-space function but I am doing something(many things, all things) wrong.
Thanks in advance for any help.
This code has worked wonders for those tags that are empty or have differing amounts of characters in them.
I have finally stumbled upon a tag that will contain either an X or an N. If it contains an X, that I have to skip that line from being printed.
I have tried variations of the following:
<xsl:if test="contains(normalize-s
and
<xsl:if test="match(normalize-spac
Even if I get past the syntax errors, it just prints my line regardless.
I think what I need to do is say something like, if test="match..... then call the normalize-space function but I am doing something(many things, all things) wrong.
Thanks in advance for any help.
<xsl:value-of select="$Line1_AppNumber"/>
<xsl:value-of select="$nl"/>
<xsl:if test="string-length(normalize-space(Rtype01)) > 0">
<xsl:value-of select="$Line2_Rtype01"/>
<xsl:value-of select="$nl"/>
</xsl:if>
<xsl:value-of select="$Line3_Rtype02"/>
<xsl:value-of select="$nl"/>
ASKER
i'm so confused. I thought that the normalize-space was what was removing the line if the condition was met.
Why does this remove the line then?
Why does this remove the line then?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
above and beyond. Thank you again, Gertone!
welcome
you should test for string values (add single quotes)
and no need for the normalize-space in the test
<xsl:if test="contains(Rtype01, 'X')">