Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

XML.ApplyStylesheet

Apply the stylesheet to the document (XSLT transform).

Component Version macOS Windows Linux Server iOS SDK
XML 8.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "XML.ApplyStylesheet"; XML; StyleSheet { ; Parameters } )   More

Parameters

Parameter Description Example Flags
XML The XML to process.
Can be XML as text or the reference returned by XML.Parse function, so you can make several times changes to the XML without parsing it each time.
"<test>Hello</test>"
StyleSheet The XML of the style sheet.
Can be XML as text or the reference returned by XML.Parse function, so you can make several times changes to the XML without parsing it each time.
Parameters The list of parameters to pass to the engine.
Pass a list with key=value format.
"id=123¶test=2" Optional

Result

Returns text or error.

Description

Apply the stylesheet to the document (XSLT transform).
Performs a XSLT transformation on the input document.
The output may be a non-wellformed output XML wise!

Returns various errors if XML is not well formed or style sheet is invalid.

Based on LibXSLT, so it provides an implementation of XSLT 1.0, plus most of the EXSLT set of processor-portable extensions functions and some of Saxon's evaluate and expressions extensions.

Examples

Apply a stylesheet:

Set Variable [ $InputXML; Value:XSLT::InputXML ]
Set Variable [ $StyleSheet; Value:XSLT::StyleSheet ]
Set Variable [ $Output; Value:MBS("XML.ApplyStylesheet"; $InputXML; $StyleSheet) ]
Set Field [ XSLT::OutputXML; $Output ]

See also

Release notes

Example Databases

Blog Entries

This function is free to use.

Created 22nd August 2018, last changed 2nd November 2021


XL.Uninitialize - XML.ApplyStylesheet2