Check if a string is null or empty in XSLT

前端 未结 14 1157
梦毁少年i
梦毁少年i 2020-11-27 09:12

How can I check if a value is null or empty with XSL?

For example, if categoryName is empty? I\'m using a when choosing construct.

For

14条回答
  •  自闭症患者
    2020-11-27 10:02

    If a node has no value available in the input xml like below xpath,

    
        
    
    

    string() function converts into empty value. So this works fine:

    string(/Node/ErrorCode) =''
    

提交回复
热议问题