Below is my xml:
<Orderdetails>
<OrderPlace>CDGV</OrderPlace>
<OrderID>1234</OrderID>
<OrderStatus>Active<OrderStatus>
</Orderdetails>
Below is my XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="no"/>
<xsl:template match="/">
<xsl:choose>
<xsl:when test = "OrderStatus=Active">
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:otherwise>
Order Status Inactive
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="*" />
</xsl:template>
</xsl:stylesheet>
I want to copy all the elements and values only when the value is 'Active' in the input xml, Otherwise it should display "Order status as Inactive".Can you please let me know where should I make changes in my XSLT ?