XML`
XML`

ToSymbolicXML

ToSymbolicXML[expr]

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

Details and Options

  • To use ToSymbolicXML, you first need to load the XML Package using Needs["XML`"].
  • ToSymbolicXML is the inverse of FromSymbolicXML.
  • 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

Examples

Basic Examples  (3)

The expression x2 returned in the corresponding SymbolicXML:

A notebook expression results in SymbolicXML representing ExpressionML:

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

(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: