Page 1 of 1

How do I check if weight is less than 50 pounds or greater t

Posted: Wed Aug 20, 2014 5:25 pm
by winkimjr2
I am wondering how to change my xslt code so that it checks if height and weight. I want to check if the weight is less than 50 pounds or greater than 499 pounds then this will not be displayed in the output.
And for the height I want to check if height is less than 48 inches or greater than 95 inches then this will not be displayed in the output.
Weight xslt code

xslt code for height

Code: Select all

<xsl:if test="HeightFeet">
<nc:PersonHeightMeasure>
<nc:MeasureText>
<xsl:choose>
<xsl:when test="HeightFeet">
<xsl:value-of select="(HeightFeet*12)+HeightInches"/>
</xsl:when>
</xsl:choose>
</nc:MeasureText>
<nc:MeasureUnitText>
<xsl:text>inches</xsl:text>
</nc:MeasureUnitText>
<nc:LengthUnitCode>
<xsl:text>INH</xsl:text>
</nc:LengthUnitCode>
</nc:PersonHeightMeasure>
</xsl:if>

Re: How do I check if weight is less than 50 pounds or great

Posted: Wed Aug 20, 2014 5:29 pm
by winkimjr2
Code for weight

Code: Select all

<xsl:if test="WeightPounds">
<nc:PersonWeightMeasure>
<nc:MeasureText>
<xsl:choose>
<xsl:when test="WeightPounds">
<xsl:value-of select="WeightPounds"/>
</xsl:when>
/xsl:choose>
</nc:MeasureText>
<nc:MeasureUnitText>
<xsl:text>pounds</xsl:text>
</nc:MeasureUnitText>
<nc:WeightUnitCode>
<xsl:text>LBR</xsl:text>
</nc:WeightUnitCode>
</nc:PersonWeightMeasure>
</xsl:if>

Re: How do I check if weight is less than 50 pounds or great

Posted: Thu Aug 21, 2014 11:11 am
by adrian
Hi,

You can just write the comparison expression in the @test attribute. Make sure the < (lower than sign) is escaped to <
e.g.

Code: Select all

<xsl:if test="WeightPounds < 50 or WeightPounds > 499">
Regards,
Adrian