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

ToCompactXML


generates an equivalent SymbolicXML expression that suppresses all the redundant namespace information for elements and attributes in expr.

suppresses only namespaces that match patt.
  • To use , you first need to load the XML Package using .
  • The following option can be given:
"AttributesDefaultNameSpace""NullNameSpace"controls how attribute namespaces are abbreviated
XML with explicit namespace information:
suppresses redundant namespace information for elements. Attributes in the null namespace always get compacted, regardless of the setting of :
Attributes in the same default namespace as the element only get compacted when is .
Attributes in other namespaces do not get compacted:
If the namespace of a tag is explicit but different from the default, attributes will not be compacted:
The default namespace may be inherited from containing tags:
Needs["XML`"]
XML with explicit namespace information:
In[2]:=
Click for copyable input
suppresses redundant namespace information for elements. Attributes in the null namespace always get compacted, regardless of the setting of :
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
Attributes in the same default namespace as the element only get compacted when is .
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
Attributes in other namespaces do not get compacted:
In[7]:=
Click for copyable input
Out[7]=
In[8]:=
Click for copyable input
Out[8]=
If the namespace of a tag is explicit but different from the default, attributes will not be compacted:
In[9]:=
Click for copyable input
Out[9]=
The default namespace may be inherited from containing tags:
In[10]:=
Click for copyable input
Out[10]=