I want to transform an XML file to text but I want also some elements not to be transformed.
e.g Input:
<parent> Some parent text
<child1>child text</child>
more parent text
</parent>
expected output:
Some parent text <child1>child text</child> more parent text
my current XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="text" indent="no"/>
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="child1">
<xsl:element name="child1">
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
But what what I get is:
Some parent text child text more parent text
is there anyway I can fix this to include some child elements?
method="text"
? – Ian Robertsparent
element to appear in the output, but everything else stays the same? – Tim C