Rank: Newbie
Groups: Registered
Joined: 7/19/2016(UTC) Posts: 3 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"
|
|
|
|
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?
|
1 user thanked bbv for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 7/19/2016(UTC) Posts: 3 Location: Gelsenkirchen Thanks: 2 times
|
Unfortunately my system uses comma instead of dot. Do I have to change this via some string-operations ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 7/19/2016(UTC) Posts: 3 Location: Gelsenkirchen Thanks: 2 times
|
That was a very good hint!!
I did it like translate(@RefMax,",",".")and now it works !!
Thanks a lot !
|
|
|
|
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.
|
1 user thanked bbv for this useful post.
|
|
|
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.