title: Xslt exclude few attributes, that are loaded dynamically, from input xml
body: <p>I need to write xsl to exclude few attributes from input xml. </p>
  
  <p>Note:exclude attributes will be loaded dynamically by using
  transformer.setParameter("attribiutes", "A,B") method in java.</p>
  
  <p>My input xml:</p>
  
  <pre><code>&lt;root&gt;
   &lt;child1 A="" B="" C="" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Below is the xsl which i was using, but its not working.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
   &lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:param name="atttributes" select="''" /&gt;
  &lt;xsl:template match="@*|node()"&gt;
      &lt;xsl:choose&gt;
          &lt;xsl:when test="contains($atttributes, @*)"&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise&gt;
              &lt;xsl:copy&gt;
                  &lt;xsl:apply-templates select="@*|node()" /&gt;
              &lt;/xsl:copy&gt;
          &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The result should be like the below xml.</p>
  
  <pre><code>&lt;root&gt;
   &lt;child1 C="" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Kindly help me out from this issue.</p>
  
  <p>Thanks in advance.</p>