Edit

Transform XML using an XSLT

APPLIES TO: All API Management tiers

The xsl-transform policy applies an XSL transformation to XML in the request or response body.

Note

Set the policy's elements and child elements in the order provided in the policy statement. Learn more about how to set or edit API Management policies.

Policy statement


    ...
    
        
        
    
  

Elements

Name Description Required
parameter Used to define variables used in the transform No
xsl:stylesheet Root stylesheet element. All elements and attributes defined within follow the standard XSLT specification. Yes

Usage

Usage notes

  • This policy can only be used once in a policy section.
  • Currently, this policy supports XSLT version 1.0.

Examples

Transform request body


    
    
        @(context.Request.Headers.GetValueOrDefault("User-Agent","non-specified"))
        
            
            
            
                
                    
                        
                            
                        
                    
                    
                
            
        
      

Transform response body


  
      
  
  
      
      
          
            
            
            
                
                    
                
            
          
    
  

For more information about working with policies, see: