Loading

JDF ticket transformation using XSLT

This topic describes:

  • How you can use XSLT to transform JDF tickets.

  • Limitations and considerations when using XSLT.

This topic does not explain XSLT or the XSLT syntax. You can find XSLT tutorials and documents online, for example, https://www.w3.org/TR/1999/REC-xslt-19991116 and http://lenzconsulting.com/how-xslt-works/.

Change the JDF ticket or activate a workflow on PRISMAsync

Using XSLT, you can transform the JDF ticket to:

  • Add settings to the JDF ticket when the sending JDF host does not supply these settings. For example:

    • Add a staple to the job settings when the jobname contains "_2staple".

    • Force PRISMAsync to use the automated workflow “yyy” when the sending application is “yyy”.

  • Transform settings sent by the JDF host but which are not supported by PRISMAsync. For example:

    • Convert "4 stitches" to "2 stitches".

  • Create a workflow for your customer on the PRISMAsync Print Server based on conditions. For example:

    • If the number of copies is larger than 10000: send the job to DocBox “Large_Jobs”.

    • If the job does not contain an account id: send the job to the list of waiting jobs, else to the list of scheduled jobs.

Use XSLT style sheets for transformation of the JDF ticket

  1. Create your XSLT style sheets.

    For the settings that you can use in a JDF ticket, see JDF ticket support.

  2. Test your XSLT style sheets.

    It is better to have multiple smaller style sheets than one large style sheet. When debugging, you can enable and disable specific style sheets. Use the log file to determine which transformation was done and which transformation failed.

    1. To test your style sheets, you can go to http://www.utilities-online.info/xsltransformation.

    2. Paste the JDF ticket in the textbox labelled "XML".

      You can validate your JDF ticket by clicking button "Check XML Well Formed".

    3. Paste the XSLT style sheet in the textbox labelled "XSL".

      You can validate your XSLT style sheet by clicking button "Check XSL Validity".

    4. Click button "Transform XML with XSL".

      The transformed JDF ticket is shown in the textbox labelled "Result".

  3. Enable one or more XSLT style sheets in the Settings Editor.

    You cannot import XSLT style sheets that use an incorrect syntax. Use the log file to determine why a style sheet was rejected.

    1. Open the Settings Editor.

    2. Click: Workflow - JDF ticket transformation.

    3. Import any XSLT style sheets and enable the XSLT style sheets that you want to use.

Analyse the transformations applied to the JDF ticket using the log file

  1. Create and download the log file, see JMF logging.

  2. Analyse the applied transformations.

    The JDF ticket transformation steps are written to the log file "JDFlog.trc". All transformations are tracked. The JDF ticket before and after each XSLT transformation are shown. In the JDF log file, you can recognise the following states of a JDF ticket:

    • An incoming JDF ticket, for example:

      *********************************************************************

      03-30-18 12:27:39 Document ID =

      ************************* input ticket *******************************

    • Each transformed JDF ticket, for example:

      *********************************************************************

      03-30-18 12:27:39 Apply script Sample-Solution-2

      ************************* ticket **************************************

    • The end of a list of transformations is shown as:

      ----------------------------------------------------------------------

      Transform requested by session JdfProcessorMediator is completed

      ----------------------------------------------------------------------

    • Enabling, disabling or deleting one or more XSLT style sheets is shown as:

      **********************************************************************

      03-30-18 12:51:12 Script name: Sample_Jobname_to_stapling-Solution-2

      *********** script deleted. Current scripts list is empty ************

      **********************************************************************

      03-30-18 12:51:12 Script name: Sample_Jobname_to_stapling-Solution-2

      ************************* script added *******************************

Limitations and considerations

  • The PRISMAsync Print Server supports XSLT 1.0 to transform JDF tickets.

  • .NET Framework version 4.6.1 parses XSLT style sheets on the print server.

  • You can enable one or more XSLT style sheets in the Settings Editor.

    It is recommended that you use less than 100 style sheets with a maximum total size of 10 MB in the Settings Editor. However, there is no limit to the amount of XSLT style sheets or to the size of the style sheets.

  • When multiple XSLT style sheets are enabled, the style sheets are executed in the order as shown in the Settings Editor.

  • All JDF tickets that PRISMAsync receives will be transformed using the enabled XSLT style sheet(s).

  • Only JDF tickets will be transformed.

    NOTE

    "Remote Manager" translates its settings into a JDF ticket. So, jobs submitted using "Remote Manager" will always use any XSLT style sheets.

    No transformation is performed, if:

    • The PRISMAsync Print Server does not recognize a JDF ticket.

    • A job does not contain a JDF ticket.

  • If one of the XSLT transformations causes an error, the original JDF ticket is used.

    This means that if one transformation fails, then no transformations will be made to the JDF ticket. The logging will show which transformation caused an error.

  • There is no timeout for the XSLT style sheets.

    This means that badly formed XSLT style sheets can continue to run for a long time, or even don't terminate at all. Such style sheets can use up the resources of the PRISMAsync Print Server making the print server unresponsive.

    The print server does not detect when an XSLT style sheet keeps running for a long time. Therefore, no warning can be sent to the control panel.

  • By default, all JDF tickets will be transformed by one or more XSLT style sheets.

    However, it is possible to process JDF tickets differently based on conditions in the XSLT style sheets. For example, you can create a condition stating when a JDF ticket must be transformed, or not.