Jump to content
winkimjr2

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

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>

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

You might have to put a slash infront of the period; as so:

./
Thank you for the like. :-) Edited by L8V2L

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...