swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

xslt.reader

 
 

Library: XSLT support (OMXSLT)
Import: omxslt.xmd
Return type: String

Returns: The result of applying the stylesheet to the xml-input argument.


Declaration

export external string source function reader
              with value     stylesheet stylesheet
        parameters read-only stream     parameters optional
              from value     source     xml-input

Argument definitions

stylesheet
is the XSLT stylesheet that will be applied to the input data,
parameters
is a shelf of parameters required by the stylesheet, and
xml-input
is a well-formed XML instance to which the stylesheet will be applied.


Purpose

Use reader to apply an XSLT stylesheet to a well-formed XML instance. The result of the transformation is emitted to #current-output, where it can be captured in a stream, or used to feed OmniMark's XML parser or its pattern-matching engine.

Usage Note

To use reader, you must import omxsltinto your program, using a statement like this:

  import "omxslt.xmd" prefixed by xslt.

Example

An XSLT stylesheet stored in a file stylesheet1.xsl can be applied to a well-formed XML instance stored in file |input1.xml using the following program.

          import "omxslt.xmd" prefixed by xslt.
          
          process
             do xml-parse scan xslt.reader with xslt.compile file "stylesheet1.xsl"
                                                  from file "input1.xml"
                suppress
             done
  
          element #implied
             suppress
        

If the stylesheet is being applied only once, there is no need to declare a shelf of type stylesheet: OmniMark can convert a stream representation of the stylesheet into the appropriate format. The above example can then be modified to read

          do xml-parse scan xslt.reader with file "stylesheet1.xsl"
                                               from file "input1.xml"
             suppress
          done
        

        Other Library Functions
   xslt.compile
   xslt.omxslt-version
   xslt.reader
   xslt.stylesheet
   xslt.writer
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.