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 |
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 |
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 |
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 |
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 |
The initial match selection must be set using one of the two methods setInitialMatchSelection or setInitialMatchSelectionFile.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Saxon | MBS XML Plugin | 25.0 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | All |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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.