function
Library: XSLT support (OMXSLT)
Import : omxslt.xmd |
Returns: The result of applying the stylesheet to the xml-input argument. |
export external string source function reader with value stylesheet stylesheet parameters read-only stream parameters optional from value string source xml-input
Argument definitions
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.
To use reader
, you must import the omxslt module into your program, using a statement like this:
import "omxslt.xmd" prefixed by xslt.
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 string source
representation of the stylesheet into the appropriate format. The
above example can then be modified to read
process do xml-parse scan xslt.reader with file "stylesheet1.xsl" from file "input1.xml" suppress done