Your output isn't valid XML, you're closing the 'Profiles' tag twice- I'm inclined to assume the first time it's closed is the erroneous one, otherwise your output will have two root elements, which also isn't valid XML.
I think this is close to what you're looking for:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"
exclude-result-prefixes="n0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="n0:EmployeeBulkReplicationRequest">
<Profiles>
<xsl:apply-templates select="*"/>
</Profiles>
</xsl:template>
<!-- MessageHeader and any descendents, output without attributes. -->
<xsl:template match="MessageHeader | MessageHeader//*">
<xsl:element name="{local-name()}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Any descendent elements of EmployeesReplicationRequest, output WITH attributes. -->
<xsl:template match="EmployeesReplicationRequest//*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
<!-- Any descendent attributes of EmployeesReplicationRequest, output 'as-is' -->
<xsl:template match="EmployeesReplicationRequest//@*">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="EmployeesReplicationRequest">
<Profiles_info>
<xsl:apply-templates select="*"/>
</Profiles_info>
</xsl:template>
</xsl:stylesheet>
XSLT to remove namespaces and rename tags.
Hi All,
I'm new to this forum hope I get help here. Here is my below Input request message.
Here is my XSLT:
My Expected Output:
Can someone please help me on this. Values in my input and output will differ in my payloads.
Your output isn't valid XML, you're closing the 'Profiles' tag twice- I'm inclined to assume the first time it's closed is the erroneous one, otherwise your output will have two root elements, which also isn't valid XML.
I think this is close to what you're looking for:
Thankyou so much. It worked as expected.
is working on a reply...