How can you remove XML elements using XSLT?
Given the below XML this XSLT can be used to remove particular elements from XML, in this example the "author" and "year" tags will be removed.
You can customize these values to meet your needs.
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKpYAAW" alt="xml.png" width="577" height="428">XML
<bookstore>
<book category="API">
<title lang="en">CA API Management</title>
<author>John Doe</author>
<year>2017</year>
<price>30.00</price>
</book>
</bookstore>
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKpZAAW" alt="xslt.png" width="761" height="744">XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="author|year"/>
</xsl:stylesheet>