65
XML Compliance
One issue with XML is that documents must be well formed, following the rules of XML. Some basic examples of
compliance are described in this section.
An XML document must include a header. For example, it must start with something like the following.
Empty elements must either have an end tag, or the start tag must end with />. Thus, the following is legal.


However, this is not legal.


For non empty tags the end tag is required. Thus the following is legal.

Here is a paragraph.

Here is another.

However, this is not legal.

Here is a paragraph.

Here is another.

5.1.2 Mathematica Support for XML
This section  gives a  very brief introduction  to the  Mathematica  tools  for working with  XML; more  information  is
available  in  the  online  documentation.  One  important  point  is  that  XML  is  suitable  for  holding  structured  data,
which also applies  to Mathematica expressions  (the basic data type of Mathematica). This makes it easy to import
XML data into Mathematica. 
The following is a simple example.
In[7]:=
xml =
" version=\"1.0\"?>\n
\n
\n
<
title>A New Kind of ScienceStephen Wolfram
author>\n
\n
 \n
The</b> <b>Lord</b> <b>of</b> <b>the</b> <b>Rings<e</b></font></pre></span>
<span name = "INTRA" style='top:1138px; left:235px' class="ft0"><pre><font face='Arial'><b>title></b> <b><author>J.R.R.</b> <b>Tolkien<eauthor>\n</b></font></pre></span>
<span name = "INTRA" style='top:1138px; left:615px' class="ft0"><pre><font face='Arial'><b><ebook>\n<elibrary>";</b></font></pre></span>
<span name = "INTRA" style='top:1173px; left:129px' class="ft0"><pre><font face='Arial'><b>This</b> <b> XML</b> <b> can</b> <b> be imported</b> <b> into Mathematica,</b> <b> which</b> <b> represents</b> <b> it with</b> <b> Symbolic</b> <b> XML.</b> <b> Because</b> <b> of</b> <b> the</b> <b> nature of</b></font></pre></span>
<span name = "INTRA" style='top:1191px; left:129px' class="ft0"><pre><font face='Arial'><b>Mathematica expressions, Symbolic XML is a Mathematica native form of XML that is isomorphic to textual XML.</b></font></pre></span>
<span name = "INTRA" style='top:1268px; left:403px' class="ft3"><pre><font face='Arial'> .</font></pre></span>
<span class='nav' style='left: 10px; top: 1010px'><pre><<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1









Comcast Web Hosting