doc/us/lom.html

Thu, 03 Apr 2014 14:30:36 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 03 Apr 2014 14:30:36 +0100
changeset 24
0d7de9d0878b
parent 0
24d141cb2d1e
permissions
-rw-r--r--

Update HTML to reference a local doc.css, and remove W3C-hosted images (a potential privacy leak)

0
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 <html>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 <head>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 <title>LuaExpat: XML Expat parsing for the Lua programming language</title>
24
0d7de9d0878b Update HTML to reference a local doc.css, and remove W3C-hosted images (a potential privacy leak)
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
6 <link rel="stylesheet" href="../doc.css" type="text/css"/>
0
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 </head>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 <body>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 <div id="container">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 <div id="product">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 <div id="product_logo"><a href="http://www.keplerproject.org">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 <img alt="LuaExpat logo" src="luaexpat.png"/>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 </a></div>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 <div id="product_name"><big><strong>LuaExpat</strong></big></div>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 <div id="product_description">XML Expat parsing for the Lua programming language</div>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 </div> <!-- id="product" -->
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 <div id="main">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 <div id="navigation">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 <h1>LuaExpat</h1>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 <ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 <li><a href="index.html">Home</a>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 <ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28 <li><a href="index.html#overview">Overview</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 <li><a href="index.html#status">Status</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30 <li><a href="index.html#download">Download</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 <li><a href="index.html#history">History</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 <li><a href="index.html#references">References</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 <li><a href="index.html#credits">Credits</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 <li><a href="index.html#contact">Contact</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 </ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 </li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 <li><a href="manual.html">Manual</a>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 <ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 <li><a href="manual.html#introduction">Introduction</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 <li><a href="manual.html#installation">Installation</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 <li><a href="manual.html#parser">Parser Objects</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 </ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 </li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 <li><a href="examples.html">Examples</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 <li><strong>Lua Object Model</strong></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 <li><a href="http://luaforge.net/projects/luaexpat/">Project</a>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 <ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 <li><a href="http://luaforge.net/tracker/?group_id=13">Bug Tracker</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 <li><a href="http://luaforge.net/scm/?group_id=13">CVS</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 </ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 </li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 <li><a href="license.html">License</a></li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53 </ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 </div> <!-- id="navigation" -->
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 <div id="content">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 <h2><a name="introduction"></a>Introduction</h2>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 <p>Lua Object Model (LOM) is a representation of XML elements
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 through Lua data types. Currently it is not supposed to be 100%
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 complete, but simple.</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64 <p>LuaExpat's distribution provides an implementation of LOM that
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 gets an XML documenta (a string) and transforms it to a Lua table.
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66 The only function exported is <strong><code>lxp.lom.parse</code></strong>.</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 <h2><a name="characteristics"></a>Characteristics</h2>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
71 <p>The model represents each XML element as a Lua table. A LOM
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
72 table has three special characteristics:</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
73
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
74 <ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
75 <li>a special field called <strong><code>tag</code></strong> that holds the
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
76 element's name;</li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
77
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
78 <li>an optional field called <strong><code>attr</code></strong> that stores
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
79 the element's attributes (see <a href="#attributes">attribute's
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
80 section</a>); and</li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
81
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
82 <li>the element's children are stored at the <em>array-part</em> of
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
83 the table. A child could be an ordinary string or another XML
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
84 element that will be represented by a Lua table following these
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
85 same rules.</li>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
86 </ul>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
87
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
88
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
89 <h3><a name="attributes"></a>Attributes</h3>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
90
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
91 <p>The special field <strong><code>attr</code></strong> is a Lua table that
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
92 stores the XML element's attributes as pairs
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
93 <em>&lt;key&gt;=&lt;value&gt;</em>. To assure an order (if
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
94 necessary), the sequence of <em>key</em>s could be placed at the
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
95 <em>array-part</em> of this same table.</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
96
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
97
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
98 <h2><a name="examples"></a>Examples</h2>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
99
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
100 <p>For a simple string like</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
101
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
102 <pre class="example">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
103 s = [[&lt;abc a1="A1" a2="A2"&gt;inside tag `abc'&lt;/abc&gt;]]
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
104 </pre>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
105
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
106 <p>A call like</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
107
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
108 <pre class="example">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
109 tab = lxp.lom.parse (s))
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
110 </pre>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
111
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
112 <p>Would result in a table equivalent to</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
113
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
114 <pre class="example">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
115 tab = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
116 ["attr"] = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
117 [1] = "a1",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
118 [2] = "a2",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
119 ["a2"] = "A2",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
120 ["a1"] = "A1",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
121 },
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
122 [1] = "inside tag `abc'",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
123 ["tag"] = "abc",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
124 }
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
125 </pre>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
126
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
127 <p>Now an example with an element nested inside another element</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
128
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
129 <pre class="example">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
130 tab = lxp.lom.parse(
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
131 [[&lt;qwerty q1="q1" q2="q2"&gt;
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
132 &lt;asdf&gt;some text&lt;/asdf&gt;
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
133 &lt;/qwerty&gt;]]
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
134 )
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
135 </pre>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
136
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
137 <p>The result would have been a table equivalent to</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
138
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
139 <pre class="example">
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
140 tab = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
141 [1] = "\
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
142 ",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
143 [2] = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
144 ["attr"] = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
145 },
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
146 [1] = "some text",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
147 ["tag"] = "asdf",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
148 },
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
149 ["attr"] = {
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
150 [1] = "q1",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
151 [2] = "q2",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
152 ["q2"] = "q2",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
153 ["q1"] = "q1",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
154 },
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
155 [3] = "\
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
156 ",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
157 ["tag"] = "qwerty",
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
158 }
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
159 </pre>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
160
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
161 <p>Note that even the <em>new-line</em> and <em>tab</em> characters are stored
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
162 on the table.</p>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
163
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
164 </div> <!-- id="content" -->
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
165
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
166 </div> <!-- id="main" -->
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
167
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
168 </div> <!-- id="container" -->
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
169
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
170 </body>
24d141cb2d1e Initial commit of LuaExpat 1.1.0
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
171 </html>

mercurial