XSL / XPath expression to check if a node contains at least one non-empty child

前端 未结 4 584
小蘑菇
小蘑菇 2020-12-14 06:52

I need to check if an XML node has at least one non-empty child. Applied to this XML the expression should return true


    

        
4条回答
  •  忘掉有多难
    2020-12-14 07:49

    
    
        
        
        
            
        
    
    

    Explanation This will find the first node with a string length greater than zero and then compares such node contents with empty string (the comparison will return the existence of a non-empty string node); this code can also be used to look for a specific criteria in any node, for example identify the existence of a node which contains specific string or starts with some character or any other condition; please use this as the inner condition of the node reference for the code to work its magic.

提交回复
热议问题