This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / Add-ons & Links / XML Capabilities / Exporting XML /

ExportString

You can convert Mathematica expressions into XML strings using the ExportString function. This function has the following syntax.

    ExportString[expr, format]

For exporting as XML, the relevant formats are "XML", "NotebookML", "ExpressionML", "MathML", and "SVG".

This command produces a SymbolicXML expression.

In[11]:=

Out[11]=

If the SymbolicXML expression is supplied as the first argument of ExportString, the resulting output is ordinary XML.

In[12]:=

Out[12]=

If the first argument is some other type of expression, the output is in the form of ExpressionML.

In[13]:=

Out[13]=

You can control various details of the export process using the ConversionOptions feature of the ExportString function. For more information, see XML Export Conversion Options.