Reputation: 321
How can I use XSL to copy everything after after the first node?
<ExternalRequest>
<ApplicationData></ApplicationData>
<ApplicationData></ApplicationData>
<ExternalRequest>
I want the output to be like this:
<ApplicationDataBatch>
<ApplicationData></ApplicationData>
<ApplicationData></ApplicationData>
<ApplicationDataBatch>
Cheers.
Upvotes: 0
Views: 69
Reputation: 101652
Your input and output are not valid XML, but assuming you changed the last tag to a closing tag, this should work:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*">
<ApplicationDataBatch>
<xsl:apply-templates select="@* | node()" />
</ApplicationDataBatch>
</xsl:template>
</xsl:stylesheet>
Upvotes: 1