Page 1 of 1
xslt: jdf to html
Posted: Mon Sep 22, 2014 12:39 pm
by ArielRauch
Hi,
I am receiving jdf files from Smartstream Director which are describing the orders.
As the email notification system is not sufficient I would like to create my own html to send it to the customer as a confirmation and to our agents.
Is there any template to start with.
Thanks
Ariel
xslt: jdf to html
Posted: Mon Sep 22, 2014 2:59 pm
by ArielRauch
ok - even easier:)
I am able to read the JDF perfectly as metadata.
How can I export the Metadata easily to either csv or HTML?
Thanks
Ariel
xslt: jdf to html
Posted: Mon Sep 22, 2014 4:30 pm
by ArielRauch
ok:)
I am trying now to read the jdf file with the metadata module - can someone give me the beginning of such a script
1. How do I open it as a dataset
2. How do I use the JDF dataset tools to search in it
Thank you
Ariel
xslt: jdf to html
Posted: Mon Sep 22, 2014 5:25 pm
by freddyp
To convert the JDF to HTML use "Export metadata"; that gives you a "job version" of the dataset. Then you convert it to HTML using "XSLT transform", you do an "Opaque pickup" (opaque because HTML is not well-behaved in XML terms) and in the "Mail send" element you choose "Associated with job" for the "Body template" property.
In the HTML template you can also use Switch variables [Job.Name], [Stats.NumberOfPages],... These will get replaced by the correct values.
Freddy
xslt: jdf to html
Posted: Mon Sep 22, 2014 5:32 pm
by ArielRauch
Hi Freddy,
thank you for your response.
1. why do I need the "export metadata"? I have the jdf file already (without any asset associated)
2. I am struggling with xslt - do you have sample to show me how to loop through the file?
thanks
Ariel
xslt: jdf to html
Posted: Tue Sep 23, 2014 9:34 am
by freddyp
If you do the transformation upfront then indeed you do not have to do "Export metadata". I was just thinking you would have the JDF attached as a dataset because you would need it to do routing and picking up variables.
Here is an example of how you get the list of inks in the JDF file into HTML. The loop is in the for-each that uses an XPath that returns multiple nodes and it adds the result to some (incomplete) HTML code.
Note that XSL is a broad topic and in combination with XPath it becomes a very broad topic which is outside the scope of this forum.
Freddy
xslt: jdf to html
Posted: Tue Sep 23, 2014 3:34 pm
by ArielRauch
thank you very much, Freddy.
When I put the jdf file into a flow -> jdf pick up -> checkpoint I can perfectly see all the information via the metadata editor.
Unfortunately, I am not able to loop through the jobs (/order/job) via xslt. When I try to reach a specific one (/order/job[1]
it works - but no way to loop through.
Any ideas?
Thanks
Ariel
xslt: jdf to html
Posted: Tue Sep 23, 2014 3:43 pm
by gabrielp
ArielRauch wrote: Unfortunately, I am not able to loop through the jobs (/order/job) via xslt. When I try to reach a specific one (/order/job[1]
it works - but no way to loop through.
Disclaimer: I know nothing about xslt. Looks interesting though!
I think this is where your looping logic happens:
So if /order/job[1] as your path works to identify one, I would try something like this:
xslt: jdf to html
Posted: Tue Sep 23, 2014 4:14 pm
by ArielRauch
to keep you all posted:
I reported my problems to enfocus support and they sent me a different "playground" to test the xslt - and what was not working before is working now!!!
Enfocus - thank you!!!
and all of you who are giving a hand - than you very much.
I am only at the beginning of this task but I will keep you all posted.
thanks again