Thanks Micheal,
The solution works if i have it in a seperate style sheet. But not i the following case
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:icns="urn:NewBusiness_ATV"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:template match="/">
<soapenv:Envelope>
<xsl:call-template name="buildSoapHeader"/>
</soapenv:Envelope>
</xsl:template>
<xsl:template name="buildSoapHeader">
<soapenv:Header>
<icns:IplusHeader>
<icns:freeFormatText>Sample Text</icns:freeFormatText>
</icns:IplusHeader>
</soapenv:Header>
</xsl:template>
<xsl:template match="@* | text() | comment() | processing-instruction()">
<xsl:copy/>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{name()}" namespace="urn:TEST">
<xsl:copy-of select="document('')/xsl:stylesheet/namespace::*[local-name() = icns']"/>
<xsl:copy-of select="namespace::*[not(local-name() = 'icns')]"/>
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
|