winkimjr2 Posted August 20, 2014 Share Posted August 20, 2014 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 More sharing options...
L8V2L Posted August 20, 2014 Share Posted August 20, 2014 (edited) 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 August 20, 2014 by L8V2L 1 Link to comment Share on other sites More sharing options...
winkimjr2 Posted August 22, 2014 Author Share Posted August 22, 2014 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 More sharing options...
L8V2L Posted August 22, 2014 Share Posted August 22, 2014 (edited) You might have to put a slash infront of the period; as so: ./ Thank you for the like. :-) Edited August 22, 2014 by L8V2L Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now