Copy parent element that contains specific child element using xslt
<p>I have a simple xml:</p>

<pre><code>&lt;custom-objects&gt;
    &lt;custom-object id="1"&gt;
        &lt;object-attribute attribute-id="address1"&gt;Warndtstr. 33&lt;/object-attribute&gt;
        &lt;object-attribute attribute-id="branch"&gt;01&lt;/object-attribute&gt;
        &lt;object-attribute attribute-id="catalogid"&gt;7991&lt;/object-attribute&gt;
        &lt;object-attribute attribute-id="exportdate"&gt;2015-09-19&lt;/object-attribute&gt;
    &lt;/custom-object&gt;
    &lt;custom-object&gt;
...
    &lt;/custom-object&gt;
&lt;/custom-objects&gt;
</code></pre>

<p>I'm trying to simply copy every <code>&lt;custom-object&gt;</code> element which contains a child where <code>@attribute-id</code> is <code>"exportdate"</code> and has a specific textvalue.</p>

<p>Here is my xslt:</p>

<pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
    &lt;xsl:strip-space elements="*"/&gt;

    &lt;xsl:template match="node()|@*"&gt;
        &lt;xsl:copy&gt;
            &lt;xsl:apply-templates select="node()|@*"/&gt;
        &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;

    &lt;xsl:template match="custom-object[object-attribute[@attribute-id='exportdate']='2015-09-19']"/&gt;
&lt;/xsl:stylesheet&gt;
</code></pre>

<p>The match is working when using as xpath. The xslt returns an empty result.</p>

<ul>
<li>Why is it not working in this case? </li>
<li>Where is my mistake?</li>
</ul>