Bug 52969 - TLE values based on XML values
Summary: TLE values based on XML values
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 1.0
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-22 10:47 UTC by simone.ranucci
Modified: 2012-04-01 13:42 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description simone.ranucci 2012-03-22 10:47:29 UTC

    
Comment 1 simone.ranucci 2012-03-22 10:48:50 UTC
Hi, all. I am new to FOP.
I am successfully creating AFP files but now I am facing a problem with TLE 
values.

It seems I can only set fixed values for TLE. I mean:
<afp:tag-logical-element name="User" value="John Doe"/>.

What I'd like to have is something like this:
<afp:tag-logical-element name="User" value="@User">

Is there someway to have this done? regards,

Simone
Comment 2 Alex Giotis 2012-03-22 12:18:35 UTC
The typical way of doing this is writing an XSLT. This takes as input an XML (containing the actual user name) and creates as output the XSL:FO. There are of course other ways such as programmatically generating the XSL:FO, using a template engine such as Apache Velocity etc.

Apache FOP's input is XSL:FO, have a look at the following links to help you with writing an XSLT.

[1] http://www.w3schools.com/xsl/
[2] http://www.mulberrytech.com/xsl/xsl-list/
Comment 3 simone.ranucci 2012-03-22 13:01:08 UTC
(In reply to comment #2)
> The typical way of doing this is writing an XSLT. This takes as input an XML
> (containing the actual user name) and creates as output the XSL:FO. There are
> of course other ways such as programmatically generating the XSL:FO, using a
> template engine such as Apache Velocity etc.
> Apache FOP's input is XSL:FO, have a look at the following links to help you
> with writing an XSLT.
> [1] http://www.w3schools.com/xsl/
> [2] http://www.mulberrytech.com/xsl/xsl-list/

It is exacly what I am doing.
I use Altova StyleVision to create an XSLT-FO.
When I have the XSLT-FO, I add the appropriate namespace to use FOP/AFP/TLE extension.
In FOP, then, I pass XML and XSLT-FO to print directly, create a PDF, a FO or (in this case) an AFP.
I still thank you and Peter for links posted but I can't still find the way to set in XSLT-FO the code tho have TLE values based on XML data. I am stuck at this point.
Comment 4 Pascal Sancho 2012-03-22 13:35:05 UTC
(In reply to comment #1)
> Hi, all. I am new to FOP.

OK, so you are asking this on FOP-user list (see [1]), witch is a good start.
There is no need to backup this thread on bug tracker, everybody monitoring FOP buglist typically does monitor FOP user list.

> What I'd like to have is something like this:
> <afp:tag-logical-element name="User" value="@User">

as said by Alexios, this seems to be related to XSLT stage.
In order to help community to understand your issue, you should provide a short XSL-FO demonstrating it.
That said, in your snippet the value of the [value] attribute is the string "@User", so, unless there is a special processing in AFP renderer for such pattern (I'm not an AFP guru), you'll get the same value "@User".

Please continue this discussion on FOP-user list before reopen this issue.
If the corresponding thread [1] conclude to an issue, feel free to reopen this.

[1] http://www.mail-archive.com/fop-users@xmlgraphics.apache.org/msg18179.html
Comment 5 Pascal Sancho 2012-03-22 15:59:54 UTC
XSLT related, see http://www.mail-archive.com/fop-users@xmlgraphics.apache.org/msg18190.html
Comment 6 Glenn Adams 2012-04-01 13:42:56 UTC
batch transition to closed for remaining resolved bugs