Getting the parent node attributes in XSL

前端 未结 2 1502
温柔的废话
温柔的废话 2021-02-18 20:21

In my XML I have the following:


  
    
      
        
          someResult         


        
2条回答
  •  感动是毒
    2021-02-18 20:52

    To move up the tree you use ".." per level ie in this instance probably

    select="../../../@something"
    

    You can also select an ancestor node by name (approx)

    select="ancestor::c[1]/@something"  
    

    See http://www.stackoverflow.com/questions/3672992 for further examples

提交回复
热议问题