How do I check if weight is less than 50 pounds or greater t
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
How do I check if weight is less than 50 pounds or greater t
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
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>
-
- Posts: 62
- Joined: Thu Jun 26, 2014 9:00 pm
Re: How do I check if weight is less than 50 pounds or great
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>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: How do I check if weight is less than 50 pounds or great
Hi,
You can just write the comparison expression in the @test attribute. Make sure the < (lower than sign) is escaped to <
e.g.
Regards,
Adrian
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">
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service