Skip to main content

%XML.XSLT.Transformer

Class %XML.XSLT.Transformer Extends %RegisteredObject [ System = 3 ]

For details on using this class, see Performing XSLT Transformations.

Implements an interface to the XSLT Parser. XML contained in a file or binary stream may be transformed

XDatas

ExampleXML

XData ExampleXML

ExampleXSL

XData ExampleXSL

Example3XSL

XData Example3XSL

Methods

BuildParams

ClassMethod BuildParams(ByRef pParams, pQuoteParams As %Boolean = 1) As %List [ Private ]

TransformFile

ClassMethod TransformFile(pSource As %String, pXSL As %String, pOutput As %String, pErrorHandler As %XML.XSLT.ErrorHandler = {$$$NULLOREF}, ByRef pParams = {$$$NULLOREF}, pCallbackHandler = {$$$NULLOREF}, pResolver As %XML.SAX.EntityResolver = {$$$NULLOREF}, pQuoteParams As %Boolean = 0) As %Status

This method transforms a source file according to an XSL stylesheet and writes the output to the specified output file. If errors occur during processing, callbacks will be made to the supplied error handler. If an error handler is not supplied then the default is to use a newly created instance of %XML.XSLT.ErrorHandler. The pParams argument is either a CoS array, or %ArrayOfDataTypes of name/value pairs to be passed as $ variables.

TransformFileWithCompiledXSL

ClassMethod TransformFileWithCompiledXSL(pSource As %String, pXSL As %XML.XSLT.CompiledStyleSheet, pOutput As %String, pErrorHandler As %XML.XSLT.ErrorHandler = {$$$NULLOREF}, ByRef pParams = {$$$NULLOREF}, pCallbackHandler = {$$$NULLOREF}, pResolver As %XML.SAX.EntityResolver = {$$$NULLOREF}, pQuoteParams As %Boolean = 0) As %Status

This method transforms a source file according to an XSL stylesheet and writes the output to the specified output file. If errors occur during processing, callbacks will be made to the supplied error handler. If an error handler is not supplied then the default is to use a newly created instance of %XML.XSLT.ErrorHandler. The pParams argument is either a CoS array, or %ArrayOfDataTypes of name/value pairs to be passed as $ variables.

TransformStringWithCompiledXSL

ClassMethod TransformStringWithCompiledXSL(pString As %String, pXSL As %XML.XSLT.CompiledStyleSheet, ByRef pOutput As %String, pErrorHandler As %XML.XSLT.ErrorHandler = {$$$NULLOREF}, ByRef pParams = {$$$NULLOREF}, pCallbackHandler = {$$$NULLOREF}, pResolver As %XML.SAX.EntityResolver = {$$$NULLOREF}, pQuoteParams As %Boolean = 0) As %Status

This method transforms a source file according to an XSL stylesheet and writes the output to the specified output file. If errors occur during processing, callbacks will be made to the supplied error handler. If an error handler is not supplied then the default is to use a newly created instance of %XML.XSLT.ErrorHandler. The pParams argument is either a CoS array, or %ArrayOfDataTypes of name/value pairs to be passed as $ variables.

TransformStream

ClassMethod TransformStream(pSource As %AbstractStream, pXSL As %AbstractStream, ByRef pOutput As %BinaryStream = {$$$NULLOREF}, pErrorHandler As %XML.XSLT.ErrorHandler = {$$$NULLOREF}, ByRef pParams = {$$$NULLOREF}, pCallbackHandler = {$$$NULLOREF}, pResolver As %XML.SAX.EntityResolver = {$$$NULLOREF}, pQuoteParams As %Boolean = 0) As %Status

This method transforms a source stream according to an XSL stylesheet and writes the output to the supplied binary stream. If errors occur during processing, callbacks will be made to the supplied error handler. If an error handler is not supplied then the default is to use a newly created instance of %XML.XSLT.ErrorHandler. The pParams argument is either a CoS array, or %ArrayOfDataTypes of name/value pairs to be passed as $ variables.

TransformStreamWithCompiledXSL

ClassMethod TransformStreamWithCompiledXSL(pSource As %AbstractStream, pXSL As %XML.XSLT.CompiledStyleSheet, ByRef pOutput As %BinaryStream = {$$$NULLOREF}, pErrorHandler As %XML.XSLT.ErrorHandler = {$$$NULLOREF}, ByRef pParams = {$$$NULLOREF}, pCallbackHandler = {$$$NULLOREF}, pResolver As %XML.SAX.EntityResolver = {$$$NULLOREF}, pQuoteParams As %Boolean = 0) As %Status

This method transforms a source stream according to an XSL stylesheet and writes the output to the supplied binary stream. If errors occur during processing, callbacks will be made to the supplied error handler. If an error handler is not supplied then the default is to use a newly created instance of %XML.XSLT.ErrorHandler. The pParams argument is either a CoS array, or %ArrayOfDataTypes of name/value pairs to be passed as $ variables.

NormalizeFileName

ClassMethod NormalizeFileName(pFilename As %String) As %String

Example

ClassMethod Example()

Example, Transform a stream. For this example, streams are derived from XDATA blocks within this class. In a real-world scenario streams would come from an external source

Example2

ClassMethod Example2()

Example 2, Transform a stream. For this example, streams are derived from XDATA blocks within this class. In a real-world scenario streams would come from an external source. The XSL specification is first compiled and then is used to transform the source. This is useful for when the same stylesheet needs to be applied to many different xml sources as it can result in considerable performance improvements.

Example3

ClassMethod Example3()

Example3, Transform a stream. For this example, streams are derived from XDATA blocks within this class. In a real-world scenario streams would come from an external source. Here we install the default Callback Handler