XPATH / XSLT: Selecting a node where the parent node's attribute matches the attribute of another node

前端 未结 4 2055
野趣味
野趣味 2021-01-06 04:08

I\'m trying to apply a transformation to the below XML using XPath and XSLT.


  
    J         


        
4条回答
  •  星月不相逢
    2021-01-06 04:42

    As an alternative to using a variable, you can make use of the "current()" operator to get the current Author node you are on

    
    

    Thus, if you take the following stylesheet

    
       
          
             
                
                   
                      
                      
                   
                   
                      
                   
                
             
          
       
    
    

    And apply it your given XML, the results should be like so

    
       
          SmithJohn
          Some Org
       
       
          AtkinsBill
          Another Org
       
    
    

提交回复
热议问题