J'ai un problème avec la traduction d'un texte!XSL traduire une mauvaise sortie
<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>
c'est le fichier .xml que je reçois de l'éditeur de ck et entre les travées j'ai un trait d'union insécable, mais arial ne peut pas afficher ce trait d'union insécable dans mon fichier .pdf. Je ne suis pas autorisé à changer la police du .pdf, donc je voudrais traduire le trait d'union non-brisé à un trait d'union «normal».
<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>
maintenant mon problème est, après la if
avec le commentaire here is my problem
, quand je ne les applique pas des modèles avant que ce soit la sortie:
This is a non breaking - //thats ok
-Testtext# some other text //thats not
mais si je les leur aplly les <xsl:value-of select=....
doesn ne fonctionne pas.
il devrait ressembler à ceci:
This is a non breaking -
Testtext- some other text
parfait, c'est un point que je ne pensais pas, fonctionne comme un charme – glove40