Remove elements based on other element's value — XSLT

前端 未结 4 1139
旧时难觅i
旧时难觅i 2020-12-20 03:36

I have a style-sheet that I am using to remove certain elements based on the value of an other element. However, it is not working ...

Sample Input XML



        
4条回答
  •  星月不相逢
    2020-12-20 04:07

    Here is a complete XSLT transformation -- short and simple (no variables, no xsl:if, xsl:choose, xsl:when, xsl:otherwise):

    
     
     
    
     
      
       
      
     
    
     
    
    

    When this transformation is applied on the provided XML document:

    
        1999
        ABC
        Testing
        Ok
    
    

    the wanted, correct result is produced:

    
       1999
       ABC
    
    

提交回复
热议问题