Application.TransformXML method (Access)

Applies an Extensible Stylesheet Language (XSL) stylesheet to an XML data file and writes the resulting XML to an XML data file.

Syntax

expression.TransformXML (DataSource, TransformSource, OutputTarget, WellFormedXMLOutput, ScriptOption)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
DataSource Required String The name and path of the XML file to import.
TransformSource Required String The name and path to the XSL file to apply to the XML data file.
OutputTarget Required String The file name and path for the resulting XML data file after applying the XSL file.
WellFormedXMLOutput Optional Boolean Setting this argument to True will create a well-formed XML file. Setting this argument to False will encode the resulting XML file in UTF-16 format. The default value is False.
ScriptOption Optional AcTransformXMLScriptOption An AcTransformXMLScriptOption constant that specifies the action taken if the XSL file contains scripting code. The default value is acPromptScript.

Return value

Nothing

Remarks

Setting the WellFormedXMLOutput argument to True will result in a run-time error if the XSL file that you apply does not result in well-formed XML.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.