Jump to content

How do I check if height is less than 48 inches or greater than 95 inches


winkimjr2
 Share

Recommended Posts

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
<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>

xslt code for height

<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>
Link to comment
Share on other sites

It'll be something like:

<xsl:if test="WeightPounds">  <nc:PersonWeightMeasure>   <nc:MeasureText>    <xsl:choose>	<xsl:when test="WeightPounds">          <xsl:value-of select="WeightPounds[. gt 50 or .  lt 499]"/>	</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><!--...--><xsl:if test="HeightFeet">  <nc:PersonHeightMeasure>    <nc:MeasureText>      <xsl:choose>        <xsl:when test="HeightFeet">	  <xsl:value-of select="(HeightFeet[. gt 48 or . lt 95])+HeightInches"/>	</xsl:when>      </xsl:choose></nc:MeasureText>
Edited by L8V2L
  • Like 1
Link to comment
Share on other sites

It'll be something like:

<xsl:if test="WeightPounds">  <nc:PersonWeightMeasure>   <nc:MeasureText>    <xsl:choose>	<xsl:when test="WeightPounds">          <xsl:value-of select="WeightPounds[. gt 50 or .  lt 499]"/>	</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><!--...--><xsl:if test="HeightFeet">  <nc:PersonHeightMeasure>    <nc:MeasureText>      <xsl:choose>        <xsl:when test="HeightFeet">	  <xsl:value-of select="(HeightFeet[. gt 48 or . lt 95])+HeightInches"/>	</xsl:when>      </xsl:choose></nc:MeasureText>

Thanks for your input.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...