2011-04-01 4 views
0

xslt1.0을 사용하고 있습니다. XSLT 1.0에서 그것을 할 수 괜찮나 - (만 교체해야합니다로 시작하는 폭) : 다른 문자열로,하지만 폭 : 내 입력 내가 -width을 대체 할xslt의 문자열 바꾸기

<xsl:variable name="string">width:12pt;border-width:13pt</xsl:variable> 

입니다.

+0

가능한 중복 [XSLT 교체 기능을 찾을 수 없습니다 (http://stackoverflow.com/questions/1069092/xslt-replace-function-not-found) –

답변

0

XSLT 1.0에는 바꾸기 기능이 없습니다. 이를 수행 할 수있는 템플릿은 here (String.Replace() in XSLT)입니다.

이처럼 사용할 수 있습니다

<xsl:variable name="string"> 
    <xsl:call-template name="string-replace-all"> 
    <xsl:with-param name="text" select="width:12pt;border-width:13pt" /> 
    <xsl:with-param name="replace" select="-width" /> 
    <xsl:with-param name="by" select="other-string" /> 
    </xsl:call-template> 
</xsl:variable>