ToSymbolicXML

ToSymbolicXML[expr]
converts an expression expr to an appropriate XML format and returns the result as SymbolicXML.

更多信息更多信息

  • To use , you first need to load the XML Package using Needs["XML`"].
  • is the inverse of FromSymbolicXML.
  • Use to generate SymbolicXML with no output to a file. Once the SymbolicXML is generated, you can write it to a file with Export.
  • The following option can be given:
  • "ExpandRawXML"Automaticwhether to convert RawXML string fragments

范例范例打开所有单元关闭所有单元

基本范例 (3)基本范例 (3)

In[1]:=
Click for copyable input

The expression returned in the corresponding SymbolicXML:

In[2]:=
Click for copyable input
Out[2]=
In[1]:=
Click for copyable input

A notebook expression results in SymbolicXML representing ExpressionML:

In[2]:=
Click for copyable input
Out[2]=
In[1]:=
Click for copyable input

can control the conversion of raw XML string segments enclosed within the wrapper:

In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

(The default setting for the option, Automatic, is equivalent to True.)

This provides an alternative to ImportString for converting a segment of text XML to SymbolicXML:

In[5]:=
Click for copyable input
Out[5]=
New to Mathematica? Find your learning path »
Have a question? Ask support »