'XSLT: Add few Variables to List
I am trying to Add a variable to a list from XML using XSTL and create the merged tag but it is not happening.
Source XML.
<Result>
<Data>
<Pass>true</Pass>
<Data>
<account>
<accountNumber>1111</accountNumber>
</account>
<account>
<accountNumber>2222</accountNumber>
</account>
</Result>
Requirement is that the output tag should have the list with Pass tag value like below.
<Student>
<accountNumber>1111</accountNumber>
<Pass>true</Pass>
<Student>
<Student>
<accountNumber>2222</accountNumber>
<Pass>true</Pass>
<Student>
Current XSLT file is giving the list but I am unable to add Pass Tag.
<xsl:template match = "Root/Result">
<xsl:apply-templates select="account"/>
</xsl:template>
<xsl:template match = "account">
<Student>
<accountNumber><xsl:value-of select="accountNumber" /></accountNumber>
</Student>
</xsl:template>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
