Thank you very much. It worked.
Horiana
Erik Rehrmann
<rehrmann@ion To: "'[EMAIL PROTECTED]'"
<[EMAIL PROTECTED]>
.ag> cc:
Subject: AW: fop -xml file.xml -xsl
file.xsl -pdf file.pdf
31/07/2001
16:31
Please
respond to
fop-dev
Hi Horiana,
using <xsl:attribute ...> should work for you. It sets an attribute to the
parent
(short version:)
<fo:block>
<xsl:attribute name="background-color">
<xsl:value-of select="@bgcolor"/>
</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="@size"/>
</xsl:attribute>
<xsl:value-of select="."/>
</fo:block>
____________________________
Erik Rehrmann
IOn AG - [EMAIL PROTECTED]
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 31. Juli 2001 15:21
An: [EMAIL PROTECTED]
Betreff: fop -xml file.xml -xsl file.xsl -pdf file.pdf
Hi all,
Here is what I want to do. I am using the "Fop" command line application giving
to it three parameters: the xml file, the xsl file and the name of the output
pdf file.
I have an xml file with the following content:
<document>
<chapter>
<title>.....</title>
<paragraph color="blue" size="19pt">
<text>..... </text>
</paragraph>
<paragraph color="red" size="10pt">
<text>..... </text>
</paragraph>
....
</chapter>
<chapter> .... </chapter>
</document>
The idea is that "color" and "size" attributes are specific to each paragraph.
The texts within different paragraphs could be coloured in different colours and
could have different sizes. I tried to build the xsl file and for a <paragraph>
I used a fo:block formatting object. The problem is that the "font_size"
attribute of fo:block formatting object has to have a fixed value, so the xsl
file should look like
<xsl:template match="paragraph">
<fo:block font-size="9pt"
font-family="sans-serif"
line-height="10pt"
text-align="start"
background-color="blue"
start-indent="1cm">
<xsl:value-of select="."/>
</fo:block>
</xsl:template>
But I would like that the "font-size" and "background-color" to take the values
(somehow and I don't know how) from xml file. I tried something like this:
<fo:block font-size=<xsl:value-of select="@size"/>
font-family="sans-serif"
line-height="10pt"
text-align="start"
background-color="blue"
start-indent="1cm">
<xsl:value-of select="."/>
</fo:block>
but it didn't work.
Can anyone help me?
Thanks,
Horiana
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]