此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

ToSymbolicXML

ToSymbolicXML[expr]
converts an expression expr to an appropriate XML format and returns the result as SymbolicXML.
  • To use ToSymbolicXML, you first need to load the XML Package using Needs["XML`"].
  • Use ToSymbolicXML 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
Needs["XML`"]
The expression x2 returned in the corresponding SymbolicXML:
In[2]:=
Click for copyable input
Out[2]=
 
Needs["XML`"]
A notebook expression results in SymbolicXML representing ExpressionML:
In[2]:=
Click for copyable input
Out[2]=
 
Needs["XML`"]
"ExpandRawXML" can control the conversion of raw XML string segments enclosed within the RawXML 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]=