xslt.compile

function

Library: XSLT support (OMXSLT)
Import : omxslt.xmd

Returns: a compiled XSLT stylesheet


Declaration
export external stylesheet function 
   compile value string source stylesheet

      

Argument definitions

stylesheet
is the XSLT stylesheet to be compiled.


Purpose

Use compile to generate a pre-compiled form of the XSLT stylesheet. In situations where a stylesheet will be used many times on multiple inputs, this will likely reduce processing time.

Example


  import "omxslt.xmd" prefixed by xslt.
  
  process
     local string          filenames  initial { "input1.xml", "input2.xml" }
     local xslt.stylesheet stylesheet initial { xslt.compile file "stylesheet1.xsl" }
  
     repeat over filenames as filename
        do xml-parse scan xslt.reader with stylesheet into file filename
           suppress
        done
     again
  
  
  element #implied
     suppress
            

Usage Notes

It is typically not necessary to use compile, as OmniMark can automatically compile an XSLT stylesheet from source form to compiled form when the need arises. However, should the same transformation be required for multiple inputs, compiling the stylesheet should improve performance.

Other Library Functions