How do i modify the XSL to change the xml format.
- by user323719
In the below XSL.
<xsl:param name="insert-file" as="document-node()" />
<xsl:template match="*">
<xsl:variable name="input">My text</xsl:variable>
<xsl:variable name="Myxml" as="element()*">
<xsl:call-template name="populateTag">
<xsl:with-param name="nodeValue" select="$input"/>
</xsl:call-template>
</xsl:variable>
<xsl:copy-of select="$Myxml"></xsl:copy-of>
</xsl:template>
<xsl:template name="populateTag">
<xsl:param name="nodeValue"/>
<xsl:for-each select="$insert-file/insert-data/data">
<xsl:choose>
<xsl:when test="@index = 1">
<a><xsl:value-of select="$nodeValue"></xsl:value-of></a>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:template>
I am getting the output as:
<?xml version="1.0" encoding="UTF-8"?
<aMy text</a
<aMy text</a
<aMy text</a
<aMy text</a
I want template "populateTag" to retun me the xml in the below format. How do i modify the template "populateTag" to achive the same.
Expected output from template "populateTag":
<?xml version="1.0" encoding="UTF-8"?
<a<a<a<aMy text</a</a</a</a
Please give your ideas.