Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Rdekiwi  
#1 Posted : Tuesday, July 19, 2016 12:22:04 PM(UTC)
Rdekiwi

Rank: Newbie

Groups: Registered
Joined: 7/19/2016(UTC)
Posts: 3
Germany
Location: Gelsenkirchen

Thanks: 2 times
I want to change the background-color of a cell by using XPATH.
It works in principle, but not for figures with decimal places.
I tried to use round and so on, but still it isn't working.

X-Path expression for background-color:
if ( round(number(@ActMax)) > round(number(@RefMax))) then "#FF0000" else "#FFFFFF"
bbv  
#2 Posted : Tuesday, July 19, 2016 12:36:12 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
There is actually no need to use round. XPath with number must work

if ( number(@ActMax) > number(@RefMax) ) then "#FF0000" else "#FFFFFF"

What happens if you use it? What are the contents of the attributes?

Also (just guessing without seeing your design and data): you are addressing your attributes with relative XPath - did you take in consideration that within a growing table the context is the row? Whereas in static tables the context doesn't change.

One more guess: I hope your attributes use . (dot) and not some other character for decimal?
thanks 1 user thanked bbv for this useful post.
Rdekiwi on 7/19/2016(UTC)
Rdekiwi  
#3 Posted : Tuesday, July 19, 2016 12:45:17 PM(UTC)
Rdekiwi

Rank: Newbie

Groups: Registered
Joined: 7/19/2016(UTC)
Posts: 3
Germany
Location: Gelsenkirchen

Thanks: 2 times
Unfortunately my system uses comma instead of dot.
Do I have to change this via some string-operations ?
Rdekiwi  
#4 Posted : Tuesday, July 19, 2016 12:52:17 PM(UTC)
Rdekiwi

Rank: Newbie

Groups: Registered
Joined: 7/19/2016(UTC)
Posts: 3
Germany
Location: Gelsenkirchen

Thanks: 2 times
That was a very good hint!!

I did it like translate(@RefMax,",",".")and now it works !!

Thanks a lot !
bbv  
#5 Posted : Tuesday, July 19, 2016 1:49:46 PM(UTC)
bbv

Rank: Administration

Groups: Registered, Administrators
Joined: 7/21/2014(UTC)
Posts: 498

Was thanked: 88 time(s) in 88 post(s)
OK. Please be aware that purely from XML standard perspective numbers are only allowed to use dots.
thanks 1 user thanked bbv for this useful post.
Rdekiwi on 7/19/2016(UTC)
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.