History | Edit

As of Saxon 9.7, it is possible to export a compiled form of a stylesheet as an XML file (called a stylesheet export file or SEF). Oxygen XML Editor includes a simple tool called Compile XSL Stylesheet for Saxon (found in the Tools menu) that does this for you.

Use-Cases for a Stylesheet Export File (SEF)

  • Use Saxon-JS to run transformations in a browser - A stylesheet export file (SEF) is needed if you want to use the Saxon-JS product to run transformations in a browser, as in the following example:
    <script type="text/javascript" src="SaxonJS/SaxonJS.min.js"></script>
    <script>
        window.onload = function() {
          SaxonJS.transform({
             stylesheetLocation: "books.sef",
             sourceLocation: "books.xml"
             });
        }     
    </script>
  • Use SEF to run transformations in Oxygen XML Editor - You can also use a stylesheet export file (SEF) in Oxygen XML Editor to apply an XSLT transformation over an XML file. This requires Saxon-EE or Saxon-PE versions of the Saxon product and you must select one of those two versions for the Target when you configure the SEF file. When configuring the XSLT transformation, you will specify the SEF file in the XSL URL field.

Compiling an SEF File

The Compile XSL Stylesheet for Saxon tool can be found in the Tools menu and it compiles a specified stylesheet as an XML file (stylesheet export file with a file extension of .sef).

Selecting this tool opens the Compile XSL Stylesheet for Saxon dialog box that allows you to configure some options for conversion.

Figure: Compile XSL Stylesheet for Saxon Dialog Box

This dialog box includes the following options:
XSL URL
Allows you to select URL of the source XSL stylesheet. You can specify the URL by using the text field, the history drop-down, or the browsing tools in the Browse drop-down list.
Target
Allows you to select the type of Saxon product that the export file will be used with. You can choose Saxon-JS, Saxon-EE, Saxon-PE, or Saxon-HE.
Output file
You can specify the path where the output file will be saved by entering it in the text field, using the Insert Editor Variables button, or using the browsing tool button.
Open in Editor
Select this option to open the resulting stylesheet export file in the main Oxygen XML Editor editing pane.
Convert
Use this button to generate the stylesheet export file according the options selected in this dialog box.