0
我使用這些代碼隱藏我的方法,我的XML(WSDL)文件:多的<xsl:模板匹配的.xslt文件中的騾子
<xsl:template match="wsdl:operation[@name = 'GetCityWeatherByZIP']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPSoapIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPSoapOut']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpGetIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpGetOut']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpPostIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpPostOut']" />
<xsl:template match="s:element[@name = 'GetCityWeatherByZIP']" />
<xsl:template match="s:element[@name = 'GetCityWeatherByZIPResponse']" />
現在我想用短短條件隱藏所有的他們而不是多個如果。其實我用這個在我的.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>
我想補充的是我**<xsl:template match**
在線,然後隱藏所有的人從特殊的IP地址,我不想寫所有我的方法這些代碼一個接一個。 我該如何做到這一點?
而且,我想隱藏這些:1.GetCityWeatherByZIPSoapIn 2.GetCityWeatherByZIPSoapOut 3.GetCityWeatherByZIPHttpGetIn 4.GetCityWeatherByZIPHttpGetOut 5. GetCityWeatherByZIP等等? – brelian 2013-02-09 06:12:52
我有這個問題,我必須定義一個 的 的 的 XSL:模板> –
brelian
2013-02-09 06:13:29
@ user1976453我上面提供應隱藏_everything_其名稱的XSLT與 「GetCityWeatherByZIP」 開始,包括所有5你列出,只有這一個模板。你不需要製作它的多個副本。不,你只需要一次聲明變量。 – JLRishe 2013-02-09 06:35:55