Xml 多重<;mule中.xslt文件中的xsl:template match

Xml 多重<;mule中.xslt文件中的xsl:template match,xml,xslt,xsd,wsdl,mule,Xml,Xslt,Xsd,Wsdl,Mule,我使用以下代码在XML(WSDL)文件中隐藏我的方法: 现在我只想使用一个条件来隐藏所有的if,而不是使用多个if。实际上,我在.xslt文件中使用了以下几行代码,用于对特殊ip地址隐藏我的方法: <xsl:template match="wsdl:operation[@name = 'GetCityWeatherByZIP']"> <xsl:variable name="rcaTrimmed" select="substring-bef

我使用以下代码在XML(WSDL)文件中隐藏我的方法:


现在我只想使用一个条件来隐藏所有的if,而不是使用多个if。实际上,我在.xslt文件中使用了以下几行代码,用于对特殊ip地址隐藏我的方法:

    <xsl:template match="wsdl:operation[@name = 'GetCityWeatherByZIP']">
   <xsl:variable name="rcaTrimmed" 
          select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />
   <xsl:if test="not($rcaTrimmed = '192.168.3.74')">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>


我想添加我所有的
***是否只想隐藏所有以“GetCityWeatherByZIP”开头的
@name
名称?如果是这样,您可以使用以下单一模板:

<xsl:template match="*[starts-with(@name, 'GetCityWeatherByZIP')]">
   <xsl:variable name="rcaTrimmed" 
          select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />
   <xsl:if test="not($rcaTrimmed = '192.168.3.74')">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>

此外,我还想隐藏以下内容:1.GetCityWeatherByPipsOAPin 2.GetCityWeatherByPipsOAPout 3.GetCityWeatherByShipPttpGetin 4.GetCityWeatherByShipPttpGetOut 5。GetCityWeatherByZIP等等?我有一个问题,对于所有这些问题,我必须定义一个@user1976453。我上面提供的XSLT应该隐藏名称以“GetCityWeatherByZIP”开头的所有内容,包括您列出的所有5个模板,只有一个模板。您不需要制作多个副本。不,你只需要声明一次变量。非常感谢,我可以得到答案。
<xsl:template match="*[starts-with(@name, 'GetCityWeatherByZIP')]">
   <xsl:variable name="rcaTrimmed" 
          select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />
   <xsl:if test="not($rcaTrimmed = '192.168.3.74')">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>
<xsl:variable name="rcaTrimmed" 
          select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />

<xsl:template match="*[starts-with(@name, 'GetCityWeatherByZIP')]">
   <xsl:if test="not($rcaTrimmed = '192.168.3.74')">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>