Update xml file by calling a C# function in xslt

后端 未结 2 685
挽巷
挽巷 2021-01-16 16:21

I have a xml file and an xslt file in my website project.

xml file:


  
    Kaushal
           


        
2条回答
  •  [愿得一人]
    2021-01-16 16:47

    Please refer answer of this question for first step of question.

    For next step of answer, use following xsl:

    
    
    
    Mr. 
    
    
      
    
    
    
    
      
    
    
      
    
    
    
    
    
      
    
    
    
    
    
      
      
        
      
    
    
    
      
    

    And add following function in MyXslExtension class:

    public string AddAge()
        {
            return "25";
        }  
    

    You will get the output like this:

    
    
    
    
    Mr. Kaushal
    Parik
    25
    
    
    Mr. bhishek
    Swarnkar
    25
    
      
    

    Hope this will help you....

提交回复
热议问题