Jump to content

How many left after strip


javajoemorgan

Recommended Posts

I'm writing some code to strip out elements from an xml based upon some rules. This part is working fine. After it is done, however, I need to determine if there are any elements left. For example, take this doc:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"    xmlns:str="http://exslt.org/strings">    <xsl:template match="@*|node()">        <xsl:copy>            <xsl:apply-templates select="@*|node()"/>        </xsl:copy>        <!-- THIS IS COUNTING THE ORIGINAL NUMBER, NOT THE NEW NUMBER -->        <xsl:if test="count(//*[local-name()='type']) = 0">            <!-- FORCE THE MESSAGE TO BE REJECTED -->        </xsl:if>    </xsl:template>    <xsl:template match="*[local-name()='type']">       <!-- STRIPS OUT TYPES THAT DON'T BELONG - WORKS -->    </xsl:template></xsl:stylesheet>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...