I have this xml input (it is a proper xml, I previously add the root tag to use the xslt).
<root>
Line 1
Line 2
Line 3</root>
And I need this output.
<root>
<line>Line 1</line>
<line>Line 2</line>
<line>Line 3</line></root>
I'm using this xslt but is producing one single line with all the three values in it.
<?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"/<xsl:template match="root"><xsl:copy><xsl:apply-templates select="text()[normalize-space()]"/></xsl:copy></xsl:template><xsl:template match="text()"><line>
<xsl:value-of select="normalize-space()"/></line></xsl:template></xsl:stylesheet>
How can I fix this to achieve the expected output?