OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] How to transform the content of a <para> element?


Hello,

In the <xsl:variable name="texte" select="translate(text(),'T','Z')" /> statement, the 'text()' function only selects the direct child text node(s)(I think only the first actually) of the para element. Try this:

<xsl:variable name="texte">
    <xsl:for-each select=".//text()">
        <xsl:value-of select="translate(.,'T','Z')" />
   
</xsl:for-each>
</xsl:variable>

I hope this helps.

NeoDoc
Maxime Bégnis
Développeur
Tél: 09.54.96.99.55 - Fax: 09.59.96.99.55
5, rue de la Touloubre
13770 Venelles

Le 25/05/2011 13:24, Christophe HARO a écrit :
9757643.11934161306322642414.JavaMail.root@spooler4-g27.priv.proxad.net" type="cite">
Hi all,

With an element <para> like this :

<para>
  This is a test.
  <emphasis>
    This is another phrase.
  </emphasis>
</para>

I want to obtain : Zhis is a test. Zhis is another phrase.
where 'Z' replaces all occurrences of 'T'.

The customization layer is :

<!-- Essai de substitution -->
<xsl:template match="db5:para">
  <xsl:variable name="texte" select="translate(text(),'T','Z')" />
  <fo:block xsl:use-attribute-sets="normal.para.spacing">
	  <xsl:value-of select="$texte" />
	  <xsl:call-template name="anchor" />
	  <xsl:apply-templates />
  </fo:block>
</xsl:template>

The content of <para> is outputed like this  : Zhis is a test. This is a test. This is another phrase.

1) I do not understand why the content before <emphasis> is outputed two times ;
2) how can I customize so that the content of <emphasis> will be also translated.

For the first point, I think that $texte is outputed (Zhis is a test.) and then <apply-templates> output This is a test. Is that right ?

Can someone help me ?

Many thanks. 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]