We help IT Professionals succeed at work.
Get Started

Check for positive and negative about in a XSL StyleSheet

abooysen2 asked
Last Modified: 2012-05-11

I have a xml that I am Transforming but one element is an amount field that contains positive's and negatives. I want to know how can I check for positive's and negatives in a XSL StyleSheet

here is my xml
<?xml version="1.0" encoding="utf-8"?><transferupload><transfer><Currency>USD</Currency><LegalEntity>xxxx</LegalEntity><Accountid>1020</Accountid><Movement>-111390.73</Movement><ValueDate>2011-05-16</ValueDate><Narration>CFC Transaction 1300192643504</Narration><Counterparty>xx TREASURY</Counterparty></transfer></transferupload>

<?xml version="1.0" encoding="utf-8"?><transferupload><transfer><Currency>USD</Currency><LegalEntity>XXX</LegalEntity><Accountid>1020</Accountid><Movement>111390.73</Movement><ValueDate>2011-05-16</ValueDate><Narration>CFC Transaction 1300192643504</Narration><Counterparty>XXXXX TREASURY</Counterparty></transfer></transferupload>

Here is my XSL StyleSheet to get my Movement element
                                          <xsl:value-of select="transferupload/transfer/Movement"/>

Now I can to check in element quantity for positive amounts and negatives abouts
                              <xsl:value-of select="if (@Movement < ) then '-1.0'
                                    else '1.0'"/>
Watch Question
Information Architect
Top Expert 2006
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE