|
Strings, Numbers, and Symbols
The String, Number, and Symbol elements are the only NotebookML elements that can directly contain character data. All other NotebookML elements are either empty elements or can only contain other elements. For example, here is a simple cell in Text style.

Here is the corresponding NotebookML.
In[1]:=
Note that each string in the cell expression is represented by a String element in NotebookML. One benefit of using a String element to describe string data is that it provides a clearer indication to XML-processing applications that the whitespace inside the string data is significant.
In addition to strings, the contents of a cell can contain numbers or symbols. These structures are represented in NotebookML using the elements Number and Symbol. For example, the Mathematica expression

has the following NotebookML representation.
<CellFrame>
<List>
<Number>1</Number>
<Number>0</Number>
</List>
<List>
<Number>0</Number>
<Number>1</Number>
</List>
</CellFrame>
Symbol elements lack any special structure. The left-hand side is rendered as an element that wraps the right-hand side which is taken as a Symbol element. As an example, consider the following Mathematica code fragment.
Sin[x]
Here is the corresponding NotebookML. The Function element is used to enclose the names of all built-in functions.
<Function>
<Symbol>Sin</Symbol>
<Symbol>x</Symbol>
</Function>
|