On 30 Jul 2009, at 16:59, Alvaro Moraleda wrote:

Hi

I'm using XSLT and FOP to convert XML to PDF. I need to indent a text
block depending on the number of initial tabs. Example:

--- XML ---
<tab><tab>hello world!!


--- XSLT ---
<fo:block start-indent="$initialTabs * 20mm">
...
</fo:block>

It depends a bit on the exact format of the input. If you have:

<text><tab/><tab/>hello world!</text>

Then all you would need to achieve the desired result is something like:

<xsl:template match="text">
  <block>
    <xsl:attribute name="start-indent">
      <xsl:value-of select="count(tab) * 20" /><xsl:text>mm</xsl:text>
    </xsl:attribute>
    <xsl:value-of select="." />
  </block>
</xsl:template>


HTH!

Regards

Andreas

Andreas Delmelle
e-mail: andreas.delmelle.AT.telenet.be
Skype: adlm0608
Jabber: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to