How to use value of GrandChild in xslt

后端 未结 1 721
一个人的身影
一个人的身影 2021-01-24 15:14

I need to use the value of the grandchild provided. I tried but was unable to fetch the value of the grandchild.

This is the xml provided to me



        
1条回答
  •  深忆病人
    2021-01-24 15:42

    You're pretty close, but there's a couple things here:

    • Nest the Product apply templates inside the Invoice template, in order to apply it recursively
    • You don't need the imperative style xsl-foreach - apply-templates is the better approach.
    • There's a couple typos in the xml with closing elements /b and in your xsl quotes class="entity'
    • There is a Products element which wraps Product

    Here's one way to do this:

    
      
        
          
            
          
        
      
    
      
           
           
      
    
      
          
             
             
          
      
    
    

    Working fiddle here

    0 讨论(0)
提交回复
热议问题