Presented by Natalie Palermo, LSU Law Center
The delivered stylesheets for WorkFlows XML report output are not always user friendly. Once opened in Excel, you can end up with an overwhelming number of columns or data split into multiple rows. This session will demonstrate how to create stylesheets without having to be an expert with XML or XSL.
1. Making WorkFlows XML Report Output
Work for You
LUC 2015
October 7-8, 2015
Natalie Palermo
LSU Law Center Library
2. Agenda
Attribution
Background
Benefits of XML report output
Drawbacks of XML report output in Excel
Solution: XSLT stylesheet
Create your own XSLT stylesheet
Q & A
3. Attribution
This presentation made possible with information
posted to the SirsiDynix Symphony System-Admin
discussion list by:
Philip Gunderson, San Diego Central Library
pgunderson@sandiego.gov
4. Background
XML
Extensible Markup Language
Markup language much like HMTL
Designed to store and transport data
Symphony 3.4 introduced XML output to some
reports
Using certain print tools (e.g., prtuser)
Come with default stylesheets
Stylesheet name is the name of the print tool (e.g., prtuser.xsl)
Custom stylesheets can be created and uploaded to the server
Symphony 3.5
Over 100 reports with XML output
5. Benefits of WF XML Report Output
Often more useful than delivered report output
Can get custom output without a custom report
Can be exported to 3rd party programs (e.g., Excel)
6. Drawbacks of XML Report Output in Excel
Unnecessary columns
Multiple rows
Ambiguous column labels
7. Solution: XSLT Stylesheet
XSL = Extensible Stylesheet Language
Stylesheet language for XML documents
XSLT = Extensible Stylesheet Language
Transformations
Stylesheet language for transforming XML documents
XSLT stylesheet
Expression of a transformation in XSLT
Knowledge of XML and XSLT is not really necessary
You will need:
XML report output from Symphony
Text editor that can format and indent XML
Notepad++ with the XML Tools plugin used for this presentation
XSLT stylesheet template
8. Create Your Own XSLT Stylesheet
1. Identify wanted columns from XML report output
2. Get XML report output from WorkFlows
3. Format XML report output
4. Identify nodes in XML report output
5. Create XSLT stylesheet
6. Link XSLT stylesheet to XML report output
7. Open XML report output in Excel
8. Upload stylesheet to Symphony (optional)
9. 1. Identify Wanted Columns from XML
Output
View finished report with XML output in Excel
Reminder: uncheck view log
Note the column headings you want
10. 2. Get XML Report Output from WorkFlows
View finished report (without log and style sheet)
If application to view XML reports is Excel:
Remove Excel as the application to view XML reports in Report
Session settings (remember not to save properties)
Save the XML file in the same directory with your
XSLT template
11. 3. Format XML Report Output
Open file in Notepad++
Click Plugins from the
menu
Click XML Tools
Click Pretty print (XML
only -- with line breaks)
13. Closer Look
Each user’s output includes:
userID, name, library, address1, address2, address3, and
note extended info
14. 4. Identify Nodes in XML Report Output
Follow the indented hierarchy of each <tag></tag>
pair
Each <tag></tag> pair represents a node
Ignore the following tags:
<?xml version="1.0" encoding="UTF-8"?>
<title></title>
<dateCreated></dateCreated>
<dateFormat></dateFormat>
<report></report> is always the highest node in the
hierarchy of WF XML report output
A node set is a set of nodes (node within a node)
16. 5. Create XSLT Stylesheet
Start with:
Top four lines mean:
This is an XML document
This is an XSLT stylesheet
The output will be XML, indented according to its hierarchy
The rules to follow will be applied to specified node set
17. 5. Create XSLT Stylesheet
Name <node1></node1>
Container for our output, like an Excel spreadsheet name
Our example: <users></users>
Supply the path for <xsl:for-each> select attribute
<xsl:for-each> represents a loop
Path is the highest XML node set that includes the data
we want included in our output
Our example: <xsl:for-each select="report/user">
Name <node2></node2>
Container for each record, like an Excel row
Our example: <userline></userline>
19. 5. Create XSLT Stylesheet
Name <node3></node3>
Container for each type of data, like an Excel column
Use tag names that you see in XML (e.g., <userID>)
Repeat and name as many times as needed
Supply the path for each <xsl:value-of> select
attribute
Path is the XML node or node set containing the data
Include attributes as needed [@name="value"]
Like an Excel cell
Examples:
20. 5. Create XSLT Stylesheet
Extended info in <node3></node3>
1st instance only
Supply the path for <xsl:value-of> select attribute
All instances
Supply <xsl:for-each> loop within the main <xsl:for-each> loop
21. 5. Create XSLT Stylesheet
Save stylesheet with a new name (e.g., listusers.xsl)
22. 6. Link XSLT Stylesheet to XML Report
Output
Add the following as line 2 to the XML report output
<?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?>
stylesheet.xsl is the name of your XSLT stylesheet
Our example: <?xml-stylesheet type="text/xsl"
href="listusers.xsl"?>
Save your XML report output
23. XML and XSLT Stylesheet Side-by-Side
Note: this stylesheet excludes displayName, library,
address2, and address3 from original XML output
24. 7. Open XML Report Output in Excel
Open Excel
Click File tab
Click Open
Navigate to XML file and click Open
Click 2nd radio button option in Import XML dialog
XSLT stylesheet will be selected
Click OK
Click Yes to open file (ignore different format
message)
Click OK to open file as an XML table
Click OK (ignore message about schema)
26. 8. Upload Stylesheet to Symphony
(Optional)
Once your stylesheet is complete, it is ready for
uploading to the Symphony server
Allows you to select the stylesheet when the report is run
Eliminates the need to link the XSLT stylesheet to the
XML
Open a Footprints to request the upload
Specify the default stylesheet upon which your custom
stylesheet was created
Stylesheet will be uploaded to the directory for that print tool
Limits availability of stylesheet to reports using the same print
tool
listusers.xsl would not be available for List Bibliography report
Now, select your custom XSLT stylesheet when
running the report and opening the XML output in