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 Thanos Panousis <pt...@gmail.com> on 2007/10/25 17:56:50 UTC
Change XSLT transformation on runtime (Object->XML+XSL->pdf)
Hello list,
I have an object CustomerList that holds a set of Customer objects; I
turn this into XML and with an appropriate XSLT I can make a nice pdf
report of every customer in it.
So given a CustomerList instance which I can turn to XML using Xstream
and a global-report.xsl file, I can make a nice pdf for every customer
in that object.
I would like though, to use the same CustomerList object to
dynamically create different kinds of reports. For example, every
customer has a "Market" attribute. I want to be able to make a "per
market" report from that object using a xsl transformation.
I would like to have the initial object with all customers of every
market(which means the same XML tree), but in some way have different
transforms that will only "look" at customers of a given market. For
example, if I want to only make a pdf of the users of market "Paris",
I can have a different XSL that will ignore all customers that don't
have "Paris" as their market name, but draw a table of the ones that
have.
How can I make the selection of "market" dynamic? I cannot hardcode
the name of every market in different .xsl files! Basically can I have
one XML file that get dynamically transformed to different pdfs? I
could of course change the initial object in the first place, and then
apply the same transform to different objects, but that would kind of
violate my design.
I hope I am clear, thank you.
Thanos.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
RE: Change XSLT transformation on runtime (Object->XML+XSL->pdf)
Posted by "Winterflood, Jonathan" <jo...@capgemini.com>.
Hi,
This should be on an XSLT list, but nonetheless:
XSLT templates can take parameters (declared by a <xsl:param name="foo"/> in the <xsl:template>)
Hopefully, your XSLT engine allows passing parameters to your template.
Alternatively, your could wrap your list in a <MARKET_PRINT print="market_to_print"></MARKET_PRINT> and add a template that matches this top element and extracts the parameter, before calling the main template with an <xsl:with-param>
Good luck,
Jonathan
-----Message d'origine-----
De : Thanos Panousis [mailto:pthanos@gmail.com]
Envoyé : jeudi 25 octobre 2007 17:57
À : fop-users@xmlgraphics.apache.org
Objet : Change XSLT transformation on runtime (Object->XML+XSL->pdf)
Hello list,
I have an object CustomerList that holds a set of Customer objects; I
turn this into XML and with an appropriate XSLT I can make a nice pdf
report of every customer in it.
So given a CustomerList instance which I can turn to XML using Xstream
and a global-report.xsl file, I can make a nice pdf for every customer
in that object.
I would like though, to use the same CustomerList object to
dynamically create different kinds of reports. For example, every
customer has a "Market" attribute. I want to be able to make a "per
market" report from that object using a xsl transformation.
I would like to have the initial object with all customers of every
market(which means the same XML tree), but in some way have different
transforms that will only "look" at customers of a given market. For
example, if I want to only make a pdf of the users of market "Paris",
I can have a different XSL that will ignore all customers that don't
have "Paris" as their market name, but draw a table of the ones that
have.
How can I make the selection of "market" dynamic? I cannot hardcode
the name of every market in different .xsl files! Basically can I have
one XML file that get dynamically transformed to different pdfs? I
could of course change the initial object in the first place, and then
apply the same transform to different objects, but that would kind of
violate my design.
I hope I am clear, thank you.
Thanos.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org