1
テキストの翻訳に問題があります!XSLは間違った出力を翻訳します
<text>This is a non breaking -</text>
<text>
<span style="">
<span style="">Testtext</span>
</span>
‑
<span style="">
<span style=""> some other text</span>
</span>
</text>
これは私が非改行ハイフンを持っているスパン間のCKエディタからとで取得する.xmlファイルですが、Arialの私の.pdfファイルで、この非改行ハイフンを表示することはできません。私は.pdfのフォントを変更することは許されていないので、改行なしのハイフンを「通常の」ハイフンに翻訳したいと思います。
<xsl:template match="text">
<fo:block>
<xsl:choose>
<xsl:when test="not(*) and contains(text(), '‑')">
<xsl:value-of select="translate(text(), '‑' , '-')"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="contains(text(), '‑')"> <!-- Here is my problem -->
<xsl:value-of select="translate(text(), '‑' , '-')"/>
<xsl:apply-templates />
</xsl:if>
<xsl:if test="not(contains(text(), '‑'))">
<xsl:apply-templates/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template>
今私の問題は、これが出力される前に、私は、テンプレートを適用しないコメントhere is my problem
、とif
後、次のとおりです。
This is a non breaking - //thats ok
-Testtext# some other text //thats not
が、私は彼らにそれらをaplly場合<xsl:value-of select=....
doesnの仕事はありません。
それは次のようになります(私はこれがここで誤動作の原因になっていると思います)text()
によって複数の項目の順序を選択しないようにするに
This is a non breaking -
Testtext- some other text
完璧な、それは私が考えなかった、魅力的な作品 – glove40