xslt: jdf to html

Post Reply
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

xslt: jdf to html

Post 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
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

xslt: jdf to html

Post 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
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

xslt: jdf to html

Post 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:



Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
ArielRauch
Advanced member
Posts: 230
Joined: Thu Aug 07, 2014 10:04 am

xslt: jdf to html

Post 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
Post Reply