0

XML(WSDL) ファイルでメソッドを非表示にするために、次のコードを使用します。

    <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']" />

ここで、複数の 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>

すべてのコードを 1行に追加し**<xsl:template match**てから、それらすべてを特別な IP アドレスから隠したいのですが、すべてのメソッドに対してこれらのコードを 1 つずつ書きたくないのです。どうすればこの目的を達成できますか?


いくつかのこと: 画像の場合、 と を使用するtopleftは、 が必要position:absoluteです。position:relative含む div に指定する必要があるため、次の場所に移動しました。

.container-3{    
  position:relative; 
}

そしてposition:absolute.top に渡されます

これにより、両方の画像と両方のテキスト領域を個別に積み重ねることができます。配置はすべて に対して相対的であったため、一部の位置を調整する必要が.container-3あり、一部の z-index 値を調整する必要がありました。

結果はhttp://jsfiddle.net/rPAPz/143/で確認できます。

これがあなたが探していたものであることを願っています。

4

1 に答える 1

1

@name「GetCityWeatherByZIP」で始まるすべてのものを非表示にするだけですか? その場合は、次の 1 つのテンプレートを使用できます。

<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>

rcaTrimmedまた、変数の定義をテンプレートの外に移動して、一度だけ計算する必要があるようにすることもお勧めします。

<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>
于 2013-02-09T05:53:38.767 に答える