xslt.stylesheet

data type

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


Purpose

The xslt.stylesheet data type encapsulates an XSLT stylesheet. Once a instance of the xslt.stylesheet data type has been created, it can be used to transform input data.

In practice, it is not necessary to directly manipulate shelves of type xslt.stylesheet: OmniMark will convert a string representation of an XSLT stylesheet into the correct representation when it is required.

Example

By declaring a shelf of type xslt.stylesheet and using it when applying a stylesheet to multiple sets of input data, you can avoid having to recompile the stylesheet for every iteration.

  import "omxslt.xmd" prefixed by xslt.
  
  process
     local xslt.stylesheet stylesheet initial { xslt.compile file "stylesheet1.xsl" }
  
     repeat over #args as file-name
        do xml-parse scan xslt.reader with stylesheet from file file-name
           suppress
        done
     again
  
  element #implied
     suppress

Usage Notes

Within your program, you can create as many instances of the xslt.stylesheet data type as you require by declaring global, local, or field shelves of type xslt.stylesheet. To use the xslt.stylesheet opaque data type in your program, you must import OMXSLT into your program using an import declaration such as:

  import "omxslt.xmd" prefixed by xslt.

Other Library Functions