You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by TAILLEZ Yannick <Ya...@gefco.fr> on 2004/10/18 16:15:14 UTC

xsl:variable with fo value

Hi everyone,

I 'm trying to do something like this :
------ Begin ------
<xsl:variable name="first_cumulative_total">
	<fo:retrieve-marker retrieve-class-name="cumulative_total"
retrieve-boundary="page" retrieve-position="first-starting-within-page"/>
</xsl:variable>
<xsl:variable name="last_cumulative_total">
	<fo:retrieve-marker retrieve-class-name="cumulative_total"
retrieve-boundary="page" retrieve-position="last-ending-within-page"/>
</xsl:variable>
<xsl:value-of select="$last_cumulative_total - $first_cumulative_total"/>
------ end ------

But the two variables are empty and retrieve-marker return a correct value.
Does it because fop parse the xslt and after the fo ?
There is a not too complex solution for this problem ?

Thanks,

Yannick Tailliez









----------------------------------------------------------------------------
Ce message ainsi que toutes pi?ces jointes (le "message") sont confidentiels
et sont exclusivement destinés ? l'usage de la personne ? laquelle ils sont
adressés. Tout point de vue ou toute opinion contenus dans ce message
expriment la pensée personnelle de leur auteur et ne représentent pas
nécessairement la position des sociétés du Groupe GEFCO. Si vous n'?tes pas
la personne ? laquelle ce message est destiné, veuillez noter que vous avez
reçu cet e-mail par erreur et qu'il vous est strictement interdit
d'utiliser, de diffuser, de transférer, d'imprimer ou de copier ce message.
Si vous avez reçu ce message par erreur, merci de contacter la personne qui
vous l'a adressé et de l'effacer immédiatement. Les sociétés du Groupe GEFCO
déclinent toute responsabilité en cas d'altération, de modification,
d'édition, de diffusion sans autorisation de ce message ou en cas
d'affection de ce message par un virus.

This message and any attachments (the "message") are confidential and
intended solely for the use of the individual to whom they are addressed.
Any views or opinions presented are solely those of the author and do not
necessarily represent those of the GEFCO Group of Companies. If you are not
the intended recipient, be advised that you have received this email in
error and that any use, dissemination, forwarding, printing, or copying of
this message is strictly prohibited. If you have received this message in
error please contact the sender and delete the message immediately. The
GEFCO Group of Companies shall not be liable for the message if altered,
changed, falsified, edited, diffused without authorization or affected by
any virus.
----------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: xsl:variable with fo value

Posted by "J.Pietschmann" <j3...@yahoo.de>.
TAILLEZ Yannick wrote:
> Hi everyone,
> 
> I 'm trying to do something like this :
> ------ Begin ------
> <xsl:variable name="first_cumulative_total">
> 	<fo:retrieve-marker retrieve-class-name="cumulative_total"
> retrieve-boundary="page" retrieve-position="first-starting-within-page"/>
> </xsl:variable>
> <xsl:variable name="last_cumulative_total">
> 	<fo:retrieve-marker retrieve-class-name="cumulative_total"
> retrieve-boundary="page" retrieve-position="last-ending-within-page"/>
> </xsl:variable>
> <xsl:value-of select="$last_cumulative_total - $first_cumulative_total"/>
> ------ end ------
> 
> But the two variables are empty and retrieve-marker return a correct value.
> Does it because fop parse the xslt and after the fo ?

No. The transformation is run first, generating a FO document. You can
do this explicitely:
  http://xml.apache.org/fop/running.html#check-input
Neither of your variables will have a non-whitespace string value
at transformation time.

> There is a not too complex solution for this problem ?

No.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: variable with fo value

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
> 

Sorry, slight mistake...
<snip />
> If you were to write just:
> <xsl:value-of select="$last_cumulative_total" />
> 

Should be:
<xsl:copy-of ...>

<xsl:value-of ...> won't return anything unless either:
a. the variable is defined using 'select' 
(as in <xsl:variable name="..." select="..." />)
or
b. the variable contains only text, no markup.

Greetz,

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: variable with fo value

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: TAILLEZ Yannick [mailto:Yannick.TAILLEZ@gefco.fr]
>
> Hi everyone,
>
> I 'm trying to do something like this :
<snip />

Hi,

IIUC,

>
> But the two variables are empty and retrieve-marker return a
> correct value.

Well... the xsl:variables wouldn't be empty. They would contain all of the
fo:retrieve-marker code you made them contain, but the following expression:

> <xsl:value-of select="$last_cumulative_total - $first_cumulative_total"/>

would try to perform a mathematical operation on two Result Tree Fragments,
and would not work.

> Does it because fop parse the xslt and after the fo ?

Yes --I think. The XSLT code is parsed/applied first (by Xalan). Then FOP
jumps in, and has its way with the resulting FO 'code'.

If you were to write just:
<xsl:value-of select="$last_cumulative_total" />

Then what FOP would get as input, would be:
<fo:retrieve-marker retrieve-class-name="cumulative_total"
                    retrieve-boundary="page"
                    retrieve-position="last-ending-within-page" />

> There is a not too complex solution for this problem ?

Depends... What does the source XML look like?


Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org