XSLT transformation that returns value and inner xml
Question: When transforming XML with XSLT how can I get inner value of tag including inner tags?
Suppose you have this XML:
<Root>SomeValue <Name>SomeName</Name> <Desc>SomeDesc</Desc> </Root>
And you want to get the following result:
SomeValue <Name>SomeName</Name> <Desc>SomeDesc</Desc>
The XSLT transformation could be like this:
<?xml version="1.0" encoding="utf-8"?> <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="/"> <xsl:copy-of select="Root/node()"/> </xsl:template> </xsl:stylesheet>