This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Transform XML document using XSLT engine


result = xslt(source, style, dest)
[result,style] = xslt(___)


result = xslt(source, style, dest) transforms an XML document using a stylesheet and returns the resulting document's URL. The function uses these inputs, the first of which is required:

  • source is the filename or URL of the source XML file. source can also specify a DOM node.

  • style is the filename or URL of an XSL stylesheet.

  • dest is the filename or URL of the desired output document. If dest is absent or empty, the function uses a temporary filename. If dest is '-tostring', the function returns the output document as a character vector.

[result,style] = xslt(___) returns a processed stylesheet appropriate for passing to subsequent XSLT calls as style. This prevents costly repeated processing of the stylesheet.

xslt(___,'-web') displays the resulting document in the Help Browser.


This example converts the file info.xml using the stylesheet info.xsl, writing the output to the file info.html. It launches the resulting HTML file in the MATLAB® Web Browser.

xslt('info.xml', 'info.xsl', 'info.html', '-web')


MATLAB uses the Saxon XSLT processor, version 6.5.5, which supports XSLT 1.0 expressions. For more information, see

For additional information on writing XSL stylesheets, see the World Wide Web Consortium (W3C®) web site,

See Also


Introduced before R2006a

Was this topic helpful?