<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0">
<!-- xsl:mode on-no-match="shallow-copy" means copy everything that does not matches a template rule -->
<xsl:mode on-no-match="shallow-copy"/>
<!-- this match on the CdtrAcct[Id/Othr/Id/text()='123456789'] will catch your rule and because there is no output, the whole structure will be skipped -->
<xsl:template match="CdtrAcct[Id/Othr/Id/text()='123456789']"/>
</xsl:stylesheet>
1条答案
按热度按时间sxpgvts31#
Transformimg Xml可以通过xslt来完成。有关如何在groovy中使用Xslt,请参阅this url。
您的问题所需的xslt如下所示:
The latest versions of Saxon-HE for Java can be found here.