troubleshooting Question

Check for positive and negative about in a XSL StyleSheet

Avatar of abooysen2
abooysen2Flag for South Africa asked on
8 Comments1 Solution1621 ViewsLast Modified:

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'"/>
Gertone (Geert Bormans)
Information Architect

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2006

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros