Platforms to show: All Mac Windows Linux Cross-Platform

Back to XsltExecutableMBS class.

XsltExecutableMBS.AddParameters(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets parameters given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys to XdmAtomicValue and values XdmValue objects internally and set parameters.

XsltExecutableMBS.AddProperties(values as Dictionary)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Sets properties given values in the dictionary.

This is a convenience function.
We loop over the entries in the dictionary, convert keys and values to string and set properties.

XsltExecutableMBS.applyTemplatesReturningFile(outfile as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke the stylesheet by applying templates to a supplied input sequence, saving the results to file.

The initial match selection must be set using one of the two methods setInitialMatchSelection or setInitialMatchSelectionFile. The result is stored in the supplied output file.

outfile: The file name where results will be stored.

XsltExecutableMBS.applyTemplatesReturningString as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke the compiled stylesheet by applying templates to a supplied input.

The initial match selection must be set using one of the two methods setInitialMatchSelection or setInitialMatchSelectionFile.

XsltExecutableMBS.applyTemplatesReturningValue as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke the compiled stylesheet by applying templates to a supplied input sequence, Saving the results as an XdmValueMBS.

The initial match selection must be set using one of the two methods setInitialMatchSelection or setInitialMatchSelectionFile.

XsltExecutableMBS.callFunctionReturningFile(functionName as String, arguments() as XdmValueMBS, outfile as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Call a public user-defined function in the already compiled stylesheet.

Here we wrap the result in an XML document, and sending this document to a specified file.

functionName: The name of the function to be called
arguments: Array of XdmValue object - he values of the arguments to be supplied to the function. These will be converted if necessary to the type as defined in the function signature, using the function conversion rules.
outfile: The file name where results will be stored.

XsltExecutableMBS.callFunctionReturningString(functionName as String, arguments() as XdmValueMBS) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Call a public user-defined function in the compiled stylesheet.

Here we wrap the result in an XML document, and serialized this document to string value.

functionName: The name of the function to be called
arguments: Array of XdmValueMBS object - he values of the arguments to be supplied to the function. These will be converted if necessary to the type as defined in the function signature, using the function conversion rules.

XsltExecutableMBS.callFunctionReturningValue(functionName as String, arguments() as XdmValueMBS) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Call a public user-defined function in the already compiled stylesheet.

Here we wrap the result in an XML document, and return the document as an XdmValueMBS

functionName: The name of the function to be called
arguments: Array of XdmValue object - he values of the arguments to be supplied to the function. These will be converted if necessary to the type as defined in the function signature, using the function conversion rules.

XsltExecutableMBS.callTemplateReturningFile(templateName as String, outputfile as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke a transformation by calling a named template and save result to file.

The results of calling the template are wrapped in a document node, which is then sent to the specified file destination. If setInitialTemplateParameters(std::Map, boolean) has been called, then the parameters supplied are made available to the called template (no error occurs if parameters are supplied that are not used).

templateName: The name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.
outfile: The file name where results will be stored.

XsltExecutableMBS.callTemplateReturningString(templateName as String = "") as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke a transformation by calling a named template and return result as a string.
Example
Var processor As New SaxonProcessorMBS
Var proc As Xslt30ProcessorMBS = processor.NewXslt30Processor

Var Input As String = "<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +_
"<xsl:template name='go'><a/></xsl:template>" +_
"</xsl:stylesheet>"

Var executable As XsltExecutableMBS = proc.compileFromString(Input)

Var result As XdmValueMBS = executable.callTemplateReturningValue("go")

Print "Result: "+result.toString

The results of calling the template are wrapped in a document node, which is then serialized as a string. If setInitialTemplateParameters(std::Map, boolean) has been called, then the parameters supplied are made available to the called template (no error occurs if parameters are supplied that are not used).

templateName: the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.

XsltExecutableMBS.callTemplateReturningValue(templateName as String = "") as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Invoke a transformation by calling a named template and return result as an XdmValue.

The results of calling the template are wrapped in a document node, which is then returned as an XdmValue. If setInitialTemplateParameters(std::Map, boolean) has been called, then the parameters supplied are made available to the called template (no error occurs if parameters are supplied that are not used).

templateName: the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.

XsltExecutableMBS.clearParameters

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clear parameter values set.

XsltExecutableMBS.clearProperties

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clears all properties.

XsltExecutableMBS.clearXslMessages

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Clear xsl:message data that are held in the Processor.

If the save to file has been enabled then clearXslMessages does not take affect.

XsltExecutableMBS.Clone as XsltExecutableMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Create a clone object of this XsltExecutable object.

Returns XsltExecutableMBS, a new copy of this object

XsltExecutableMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The private constructor.

XsltExecutableMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The destructor.

XsltExecutableMBS.exportStylesheet(filename as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Produce a representation of the compiled stylesheet.

The representation of the compiled stylesheet is in an XML form, suitable for distribution and reloading. If the configuration under which the export takes place is suitably licensed, then license information will be included in the export file allowing execution of the stylesheet without any additional license.

The detailed form of the output representation is not documented.

filename: the destination for the XML document containing the diagnostic representation of the compiled stylesheet. The stream will be closed when writing has finished.

XsltExecutableMBS.ParameterValue(name as String) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Get/Set a parameter.

Name: The name of the parameter, as a string.
For namespaced parameter use the JAXP solution i.e. "{uri}name" value of the query parameter.
Assign "" to clear a previously set value.

Some of the properties on this class may just internally set/get a parameter.
(Read and Write computed property)

XsltExecutableMBS.PropertyValue(name as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
A property specific to the processor in use.

Some of the properties on this class may just internally set/get a property.

Set or geta property specific to the processor in use. XsltProcessor: set serialization properties (names start with '!' i.e. name "!method" -> "xml") 'o':outfile name, 'it': initial template, 'im': initial mode, 's': source as file name 'm': switch on message listener for xsl:message instructions.
(Read and Write computed property)

XsltExecutableMBS.removeParameter(name as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Remove a parameter (name, value) pair.

Please pass the name of the parameter.
Returns outcome of the removal, true if found.

XsltExecutableMBS.removeProperty(name as String) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Remove a property (name, value) pair from the executable.

name: the name of the property to be removed.

Returns bool, the outcome of the removal.

XsltExecutableMBS.setCaptureResultDocuments(flag as Boolean, rawResults as Boolean = false)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Enable the capture of the result-document output into a Dictionary.

This overrides the default mechanism.

If this option is enabled, then any document created using xsl:result-document is saved (as an XdmNode) in an std::map object where it is accessible using the URI as a key. After the execution of the transformation a call on the getResultDocuments() method is required to get access to the result-documents in the map.

flag: true causes secondary result documents from the transformation to be saved in a map; false disables this option.
rawResults: true enables the handling of raw destination for resultsDocuments. If not supplied this can also be set on the setResultAsRawValue method. The setResultAsRawValue method has higher priority to this flag

XsltExecutableMBS.setGlobalContextFromFile(File as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Supply the context item to be used when evaluating global variables and parameters.

Set the source from file for the transformation.
file: the item to be used as the context item within the initializers of global variables and parameters.

XsltExecutableMBS.setGlobalContextFromPath(Path as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Supply the context item to be used when evaluating global variables and parameters.

Set the source from file for the transformation.
Path: the item to be used as the context item within the initializers of global variables and parameters.

XsltExecutableMBS.SetGlobalContextItem(Item as XdmItemMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Supply the context item to be used when evaluating global variables and parameters.

Set the source document from an XdmNode for the transformation.

Pass the item to be used as the context item within the initializers of global variables and parameters. Given as a XdmItemMBS object.

XsltExecutableMBS.setInitialMatchSelection(selection as XdmValueMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The initial value to which templates are to be applied (equivalent to the select attribute of xsl:apply-templates)

selection: The value to which the templates are to be applied

Some examples using this method:

XsltExecutableMBS.setInitialMatchSelectionAsFile(Path as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
The initial filename to which templates are to be applied (equivalent to the select attribute of xsl:apply-templates).

The file is parsed internally.
filename: The file name to which the templates are to be applied

XsltExecutableMBS.setInitialTemplateParameters(values as Dictionary, tunnel as Boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Set parameters to be passed to the initial template.

These are used whether the transformation is invoked by applying templates to an initial source item, or by invoking a named template. The parameters in question are the xsl:param elements appearing as children of the xsl:template element.
The parameters are supplied in the form of a map; the key is a QName given as a string which must match the name of the parameter; the associated value is an XdmValue containing the value to be used for the parameter. If the initial template defines any required parameters, the map must include a corresponding value. If the initial template defines any parameters that are not present in the map, the default value is used. If the map contains any parameters that are not defined in the initial template, these values are silently ignored.

The supplied values are converted to the required type using the function conversion rules. If conversion is not possible, a run-time error occurs (not now, but later, when the transformation is actually run).

The XsltTransformer retains a reference to the supplied map, so parameters can be added or changed until the point where the transformation is run.

The XSLT 3.0 specification makes provision for supplying parameters to the initial template, as well as global stylesheet parameters. Although there is no similar provision in the XSLT 1.0 or 2.0 specifications, this method works for all stylesheets, regardless whether XSLT 3.0 is enabled or not.

parameters: the parameters to be used for the initial template
tunnel: true if these values are to be used for setting tunnel parameters; false if they are to be used for non-tunnel parameters

XsltExecutableMBS.setSaveXslMessage(show as Boolean, filename as String = "")

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
This method gives users the option to switch on or off the xsl:message feature.

It is also possible to send the xsl:message outputs to file given by file name.
show - boolean to indicate if xsl:message should be outputted. Default is on.

filename: If the filename argument is present then the xsl:message output is appended to the given filename with location cwd+filename

Some examples using this method:

XsltExecutableMBS.transformFileToFile(sourcefile as String, outputfile as String)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Perform a one shot transformation.

The result is stored in the supplied outputfile.

sourcefile: The file name of the source document
outputfile: The file name where results will be stored.

XsltExecutableMBS.transformFileToString(filename as String) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Perform a one shot transformation.

The result is returned as a string

sourcefile: The file name of the source document Returns char array - result of the transformation.

XsltExecutableMBS.transformFileToValue(filename as String) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Perform a one shot transformation.

The result is returned as an XdmValueMBS.

sourcefile: The file name of the source document Returns XdmValue - result of the transformation.

XsltExecutableMBS.transformToFile(source as XdmNodeMBS = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Execute transformation to file. Properties supplied in advance.

Perform the transformation based upon a compiled stylesheet and source document. Assume the output file has been set in advance

source: source document supplied as an XdmNodeMBS object. nil accepted if source document has been set already.

XsltExecutableMBS.transformToString(source as XdmNodeMBS = nil) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Execute transformation to string. Properties supplied in advance.

Perform the transformation based upon what has been cached.
source - source document supplied as an XdmNode object. nullptr accepted if source document has been set already.

Result returned as a string.

Some examples using this method:

XsltExecutableMBS.transformToValue(source as XdmNodeMBS = nil) as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Execute transformation to Xdm Value.

Properties supplied in advance.

Perform the transformation based upon cached stylesheet and any source document.

source: source document supplied as an XdmNode object. nil accepted if source document has been set already. Returns as an XdmValueMBS.

XsltExecutableMBS.XslMessages as XdmValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Saxon MBS XML Plugin 25.0 ✅ Yes ✅ Yes ✅ Yes ❌ No All
Get the messages written using the xsl:message instruction.

Returns nil if the user has not enabled capturing of xsl:messages via setSaveXslMessage() Returns XdmValueMBS, the sequence of xsl:messages as an XdmValue

The items on this page are in the following plugins: MBS XML Plugin.


The biggest plugin in space...