Hi i need to convert the xml to xml
inut xml is
<associds>
<associd>
<associdentifierValue>12345</associdentifierValue>
<associdtype>AAA</associdtype>
</associd>
<associd>
<associdentifierValue>24688</associdentifierValue>
<associdtype>BBB</associdtype>
</associd>
</associds>
expected out is if child element value is BBB - i need to remove the whole element in associd.
<associds>
<associd>
<associdentifierValue>12345</associdentifierValue>
<associdtype>AAA</associdtype>
</associd>
</associds>
XSLT is given below, but it is removing only associdtype is BBB , i need to remove entire parent. i need as soon as possible.. Thanks in advance.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp"
exclude-result-prefixes="dp">
<xslutput method="xml"/>
<!-- Confidential#1 access-denied fields-->
<xsl:template match="associdtype[.='BBB']">
</xsl:template>
<!-- Rest of the response fields are allowed to pass from service output -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
inut xml is
<associds>
<associd>
<associdentifierValue>12345</associdentifierValue>
<associdtype>AAA</associdtype>
</associd>
<associd>
<associdentifierValue>24688</associdentifierValue>
<associdtype>BBB</associdtype>
</associd>
</associds>
expected out is if child element value is BBB - i need to remove the whole element in associd.
<associds>
<associd>
<associdentifierValue>12345</associdentifierValue>
<associdtype>AAA</associdtype>
</associd>
</associds>
XSLT is given below, but it is removing only associdtype is BBB , i need to remove entire parent. i need as soon as possible.. Thanks in advance.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp"
exclude-result-prefixes="dp">
<xslutput method="xml"/>
<!-- Confidential#1 access-denied fields-->
<xsl:template match="associdtype[.='BBB']">
</xsl:template>
<!-- Rest of the response fields are allowed to pass from service output -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>