MOSS07によって自動的に作成されたリンクを%20を含むスペースに変更する必要があります。%20へのリンクのXSL空間の変更
例:
{$SafeLinkURL}
スペース
https://stackoverflow.com/example%20of%20spaces
の出力https://stackoverflow.com/example誰もがこの上でいくつかの光を当てることができた場合は、行ってくださいます。事前に
おかげで、
ニック
MOSS07によって自動的に作成されたリンクを%20を含むスペースに変更する必要があります。%20へのリンクのXSL空間の変更
例:
{$SafeLinkURL}
スペース
https://stackoverflow.com/example%20of%20spaces
の出力https://stackoverflow.com/example誰もがこの上でいくつかの光を当てることができた場合は、行ってくださいます。事前に
おかげで、
ニック
この質問にを求めているまさに明確ではありません。
問題は「%20」で指定した文字列内のすべてのスペース文字を交換する場合に、ここにXSLTソリューションです:この変換は、このXML文書に適用される場合
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="link/text()[contains(., ' ')]">
<xsl:call-template name="replace"/>
</xsl:template>
<xsl:template name="replace">
<xsl:param name="pText" select="."/>
<xsl:param name="pTarget" select="' '"/>
<xsl:param name="pReplacement" select="'%20'"/>
<xsl:choose>
<xsl:when test="not(contains($pText, $pTarget))">
<xsl:value-of select="$pText"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=
"substring-before($pText, $pTarget)"/>
<xsl:value-of select="$pReplacement"/>
<xsl:call-template name="replace">
<xsl:with-param name="pText" select=
"substring-after($pText, $pTarget)"/>
<xsl:with-param name="pTarget" select="$pTarget"/>
<xsl:with-param name="pReplacement"
select="$pReplacement"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
:
<link>http://stackoverflow.com/example of spaces</link>
指名手配、正しい結果がが生成されます
<link>http://stackoverflow.com/example%20of%20spaces</link>
XSLT 2.0機能(S)Dimitrieが言及は、次のとおり
詳細な明細書および実施例のリンクを参照してください。あなたの場合(XSLT 2.0プロセッサを使用していた可能性がある場合)、fn:iri-to-uri()
はあなたの問題を解決しました。
ただし、これらの関数は現在のXSLT 1.0環境では動作しません。だから、この記事を他の人のための将来の参考資料として見てください。
良い質問、+1。完全なXSLT 1.0ソリューションについては私の答えを見てください。 :) –