This should be fairly simple, I have some XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--Arbortext, Inc., 1988-2012, v.4002-->
<?Pub Inc?>
<chapter role="h1" xml:id="chapter_N3944673" xmlns="http://docbook.org/ns/docbook">
<title>Release Notes</title>
<dynamic_block role="ta_TopicAlias">ReleaseNotes</dynamic_block>
<sidebar outputformat="html_only">
<para condition="wip">Release Preview Draft</para>
<para>Revision Date: August 17, 2016</para>
</sidebar>
That's just a fragment, you may notice it's docBook format. I want to remove all the para nodes that have a value for @condition. So I did this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="//para[@condition]" />
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Which doesn't do anything. I also tried //@condition which just removes the attribute and leaves the node intact. Further, para can appear all over the document inside other tags.
If XSL isn't the best approach I'm open to other ideas.