SAP CPI accessing properties or headers in XSL Mapping
Accessing a header or a property in a XSL mapping is verryy easy in SAP CPI.
It only needs too define a Param with the Header oor Property namem to access it in the script.
Let’s say we have a Header called CST_MyCustomHeader.
First : Declare the Header with a XSL param :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="3.0"><xsl:paramname="CST_MyCustomHeader"/>...
If we need s default value for Unit Testing mappings we can set it like this :
```xml
<xsl:paramname="CST_MyCustomHeader"select="My default value"/>...
Then in the XSL, use a value-of too get the value :
```xml
...
<xsl:value-ofselect="$CST_MyCustomHeader"/> ...