Can you put two conditions in an xslt test attribute?

后端 未结 4 934
情深已故
情深已故 2021-01-31 00:53

Is this right for When 4 < 5 and 1 < 2 ?




         


        
4条回答
  •  孤街浪徒
    2021-01-31 01:29

    Maybe this is a no-brainer for the xslt-professional, but for me at beginner/intermediate level, this got me puzzled. I wanted to do exactly the same thing, but I had to test a responsetime value from an xml instead of a plain number. Following this thread, I tried this:

     
    

    which generated an error. This works:

    
    

    Don't really understand why it doesn't work without number(), though. Could it be that without number() the value is treated as a string and you can't compare numbers with a string?

    Anyway, hope this saves someone a lot of searching...

提交回复
热议问题