|
|
|
@ -44,18 +44,20 @@ which determines which value you want to look at in the <a |
|
|
|
|
href='#mxml_value_t'><tt>value</tt></a> union.</p> |
|
|
|
|
|
|
|
|
|
<p>New nodes can be created using the <a |
|
|
|
|
href='#mxmlNewElement'><tt>mxmlNewElement()</tt></a>, |
|
|
|
|
<a |
|
|
|
|
href='#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a>, |
|
|
|
|
<a |
|
|
|
|
href='#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a>, |
|
|
|
|
<a href='#mxmlNewReal'><tt>mxmlNewReal()</tt></a>, |
|
|
|
|
and <a |
|
|
|
|
href='#mxmlNewText'><tt>mxmlNewText()</tt></a> |
|
|
|
|
functions. Only elements can have child nodes, and the top node |
|
|
|
|
must be an element, usually "?xml".</p> |
|
|
|
|
|
|
|
|
|
<p>Each node has pointers for the node above (<tt>parent</tt>), |
|
|
|
|
href='#mxmlNewElement'><tt>mxmlNewElement()</tt></a>, <a |
|
|
|
|
href='#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a>, <a |
|
|
|
|
href='#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a>, <a |
|
|
|
|
href='#mxmlNewReal'><tt>mxmlNewReal()</tt></a>, <a |
|
|
|
|
href='#mxmlNewText'><tt>mxmlNewText()</tt></a> <a |
|
|
|
|
href='#mxmlNewTextf'><tt>mxmlNewTextf()</tt></a> <a |
|
|
|
|
href='#mxmlNewXML'><tt>mxmlNewXML()</tt></a> functions. Only |
|
|
|
|
elements can have child nodes, and the top node must be an |
|
|
|
|
element, usually <tt><?xml version="1.0"?></tt>.</p> |
|
|
|
|
|
|
|
|
|
<p>Each node has a <tt>user_data</tt> member which allows you to |
|
|
|
|
associate application-specific data with each node as needed.</p> |
|
|
|
|
|
|
|
|
|
<p>Node also have pointers for the node above (<tt>parent</tt>), |
|
|
|
|
below (<tt>child</tt>), to the left (<tt>prev</tt>), and to the |
|
|
|
|
right (<tt>next</tt>) of the current node. If you have an XML |
|
|
|
|
file like the following:</p> |
|
|
|
@ -73,21 +75,20 @@ file like the following:</p> |
|
|
|
|
</group> |
|
|
|
|
<node>val7</node> |
|
|
|
|
<node>val8</node> |
|
|
|
|
<node>val9</node> |
|
|
|
|
</data> |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>the node tree returned by <tt>mxmlLoadFile()</tt> would look |
|
|
|
|
like the following in memory:</p> |
|
|
|
|
<p>the node tree for the file would look like the following in |
|
|
|
|
memory:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
?xml |
|
|
|
|
| |
|
|
|
|
data |
|
|
|
|
| |
|
|
|
|
node - node - node - group - node - node - node |
|
|
|
|
| | | | | | | |
|
|
|
|
val1 val2 val3 | val7 val8 val9 |
|
|
|
|
node - node - node - group - node - node |
|
|
|
|
| | | | | | |
|
|
|
|
val1 val2 val3 | val7 val8 |
|
|
|
|
| |
|
|
|
|
node - node - node |
|
|
|
|
| | | |
|
|
|
@ -106,7 +107,80 @@ particular node or the entire tree:</p> |
|
|
|
|
mxmlDelete(tree); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<!-- NEED 15 --> |
|
|
|
|
<!-- NEW PAGE --> |
|
|
|
|
<h2>Creating XML Documents</h2> |
|
|
|
|
|
|
|
|
|
<p>You can create and update XML documents in memory using the |
|
|
|
|
various <tt>mxmlNew</tt> functions. The following code will |
|
|
|
|
create the XML document described in the previous section:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
mxml_node_t *xml; /* <?xml ... ?> */ |
|
|
|
|
mxml_node_t *data; /* <data> */ |
|
|
|
|
mxml_node_t *node; /* <node> */ |
|
|
|
|
mxml_node_t *group; /* <group> */ |
|
|
|
|
|
|
|
|
|
xml = mxmlNewXML("1.0"); |
|
|
|
|
|
|
|
|
|
data = mxmlNewElement(xml, "data"); |
|
|
|
|
|
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val1"); |
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val2"); |
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val3"); |
|
|
|
|
|
|
|
|
|
group = mxmlNewElement(data, "group"); |
|
|
|
|
|
|
|
|
|
node = mxmlNewElement(group, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val4"); |
|
|
|
|
node = mxmlNewElement(group, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val5"); |
|
|
|
|
node = mxmlNewElement(group, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val6"); |
|
|
|
|
|
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val7"); |
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val8"); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>We start by creating the <tt><?xml version="1.0"?></tt> |
|
|
|
|
node common to all XML files using the <a |
|
|
|
|
href="#mxmlNewXML"><tt>mxmlNewXML</tt></a> function:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
xml = mxmlNewXML("1.0"); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>We then create the <tt><data></tt> node used for this |
|
|
|
|
document using the <a |
|
|
|
|
href="#mxmlNewElement"><tt>mxmlNewElement</tt></a> function. The |
|
|
|
|
first argument specifies the parent node (<tt>xml</tt>) while the |
|
|
|
|
second specifies the element name (<tt>data</tt>):</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
data = mxmlNewElement(xml, "data"); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>Each <tt><node>...</node></tt> in the file is |
|
|
|
|
created using the <tt>mxmlNewElement</tt> and <a |
|
|
|
|
href="#mxmlNewText"><tt>mxmlNewText</tt></a> functions. The first |
|
|
|
|
argument of <tt>mxmlNewText</tt> specifies the parent node |
|
|
|
|
(<tt>node</tt>). The second argument specifies whether whitespace |
|
|
|
|
appears before the text - 0 or false in this case. The last |
|
|
|
|
argument specifies the actual text to add:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
node = mxmlNewElement(data, "node"); |
|
|
|
|
mxmlNewText(node, 0, "val1"); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>The resulting in-memory XML document can then be saved or |
|
|
|
|
processed just like one loaded from disk or a string.</p> |
|
|
|
|
|
|
|
|
|
<!-- NEW PAGE --> |
|
|
|
|
<h2>Loading XML</h2> |
|
|
|
|
|
|
|
|
|
<p>You load an XML file using the <a |
|
|
|
@ -115,10 +189,11 @@ function:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
FILE *fp; |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *tree; |
|
|
|
|
mxml_node_t *tree; |
|
|
|
|
|
|
|
|
|
fp = fopen("filename.xml", "r"); |
|
|
|
|
tree = <a href='#mxmlLoadFile'>mxmlLoadFile</a>(NULL, fp, MXML_NO_CALLBACK); |
|
|
|
|
tree = mxmlLoadFile(NULL, fp, |
|
|
|
|
MXML_TEXT_CALLBACK); |
|
|
|
|
fclose(fp); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
@ -133,14 +208,18 @@ opened by <tt>fopen()</tt> or <tt>popen()</tt>. You can also use |
|
|
|
|
<tt>stdin</tt> if you are implementing an XML filter |
|
|
|
|
program.</p> |
|
|
|
|
|
|
|
|
|
<p>The third argument specifies a callback function which |
|
|
|
|
returns the value type of the immediate children for a new |
|
|
|
|
element node: <tt>MXML_INTEGER</tt>, <tt>MXML_OPAQUE</tt>, |
|
|
|
|
<tt>MXML_REAL</tt>, or <tt>MXML_TEXT</tt>. Load callbacks are |
|
|
|
|
described in detail in <a href='#LOAD_CALLBACKS'>Chapter 3</a>. |
|
|
|
|
The example code uses the <tt>MXML_NO_CALLBACK</tt> constant |
|
|
|
|
which specifies that all data nodes in the document contain |
|
|
|
|
whitespace-separated text values.</p> |
|
|
|
|
<p>The third argument specifies a callback function which returns |
|
|
|
|
the value type of the immediate children for a new element node: |
|
|
|
|
<tt>MXML_CUSTOM</tt>, <tt>MXML_IGNORE</tt>, |
|
|
|
|
<tt>MXML_INTEGER</tt>, <tt>MXML_OPAQUE</tt>, <tt>MXML_REAL</tt>, |
|
|
|
|
or <tt>MXML_TEXT</tt>. Load callbacks are described in detail in |
|
|
|
|
<a href='#LOAD_CALLBACKS'>Chapter 3</a>. The example code uses |
|
|
|
|
the <tt>MXML_TEXT_CALLBACK</tt> constant which specifies that all |
|
|
|
|
data nodes in the document contain whitespace-separated text |
|
|
|
|
values. Other standard callbacks include |
|
|
|
|
<tt>MXML_IGNORE_CALLBACK</tt>, <tt>MXML_INTEGER_CALLBACK</tt>, |
|
|
|
|
<tt>MXML_OPAQUE_CALLBACK</tt>, and |
|
|
|
|
<tt>MXML_REAL_CALLBACK</tt>.</p> |
|
|
|
|
|
|
|
|
|
<p>The <a href='#mxmlLoadString'><tt>mxmlLoadString()</tt></a> |
|
|
|
|
function loads XML node trees from a string:</p> |
|
|
|
@ -148,11 +227,11 @@ function loads XML node trees from a string:</p> |
|
|
|
|
<!-- NEED 10 --> |
|
|
|
|
<pre> |
|
|
|
|
char buffer[8192]; |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *tree; |
|
|
|
|
mxml_node_t *tree; |
|
|
|
|
|
|
|
|
|
... |
|
|
|
|
tree = <a href='#mxmlLoadString'>mxmlLoadString</a>(NULL, buffer, |
|
|
|
|
MXML_NO_CALLBACK); |
|
|
|
|
tree = mxmlLoadString(NULL, buffer, |
|
|
|
|
MXML_TEXT_CALLBACK); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>The first and third arguments are the same as used for |
|
|
|
@ -162,6 +241,7 @@ document including the <tt>?xml</tt> element if the parent node |
|
|
|
|
is <tt>NULL</tt>.</p> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- NEW PAGE --> |
|
|
|
|
<h2>Saving XML</h2> |
|
|
|
|
|
|
|
|
|
<p>You save an XML file using the <a |
|
|
|
@ -169,10 +249,10 @@ href='#mxmlSaveFile'><tt>mxmlSaveFile()</tt></a> function:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
FILE *fp; |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *tree; |
|
|
|
|
mxml_node_t *tree; |
|
|
|
|
|
|
|
|
|
fp = fopen("filename.xml", "w"); |
|
|
|
|
<a href='#mxmlSaveFile'>mxmlSaveFile</a>(tree, fp, MXML_NO_CALLBACK); |
|
|
|
|
mxmlSaveFile(tree, fp, MXML_NO_CALLBACK); |
|
|
|
|
fclose(fp); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
@ -186,8 +266,8 @@ by <tt>fopen()</tt> or <tt>popen()</tt>. You can also use |
|
|
|
|
program.</p> |
|
|
|
|
|
|
|
|
|
<p>The third argument is the whitespace callback to use when |
|
|
|
|
saving the file. Whitespace callbacks are covered in detail in |
|
|
|
|
<a href='SAVE_CALLBACKS'>Chapter 3</a>. The example code above |
|
|
|
|
saving the file. Whitespace callbacks are covered in detail in <a |
|
|
|
|
href='SAVE_CALLBACKS'>Chapter 3</a>. The previous example code |
|
|
|
|
uses the <tt>MXML_NO_CALLBACK</tt> constant to specify that no |
|
|
|
|
special whitespace handling is required.</p> |
|
|
|
|
|
|
|
|
@ -199,14 +279,14 @@ functions save XML node trees to strings:</p> |
|
|
|
|
<pre> |
|
|
|
|
char buffer[8192]; |
|
|
|
|
char *ptr; |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *tree; |
|
|
|
|
mxml_node_t *tree; |
|
|
|
|
|
|
|
|
|
... |
|
|
|
|
<a href='#mxmlSaveString'>mxmlSaveString</a>(tree, buffer, sizeof(buffer), |
|
|
|
|
mxmlSaveString(tree, buffer, sizeof(buffer), |
|
|
|
|
MXML_NO_CALLBACK); |
|
|
|
|
|
|
|
|
|
... |
|
|
|
|
ptr = <a href='#mxmlSaveAllocString'>mxmlSaveAllocString</a>(tree, MXML_NO_CALLBACK); |
|
|
|
|
ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>The first and last arguments are the same as used for |
|
|
|
@ -216,8 +296,25 @@ a fixed-size buffer, while <tt>mxmlSaveAllocString()</tt> |
|
|
|
|
returns a string buffer that was allocated using |
|
|
|
|
<tt>malloc()</tt>.</p> |
|
|
|
|
|
|
|
|
|
<h3>Controlling Line Wrapping</h3> |
|
|
|
|
|
|
|
|
|
<h3>Finding and Iterating Nodes</h3> |
|
|
|
|
<p>When saving XML documents, Mini-XML normally wraps output |
|
|
|
|
lines at column 75 so that the text is readable in terminal |
|
|
|
|
windows. The <a |
|
|
|
|
href='#mxmlSetWrapMargin'><tt>mxmlSetWrapMargin</tt></a> function |
|
|
|
|
overrides the default wrap margin:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
/* Set the margin to 132 columns */ |
|
|
|
|
mxmlSetWrapMargin(132); |
|
|
|
|
|
|
|
|
|
/* Disable wrapping */ |
|
|
|
|
mxmlSetWrapMargin(0); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- NEW PAGE--> |
|
|
|
|
<h2>Finding and Iterating Nodes</h2> |
|
|
|
|
|
|
|
|
|
<p>The <a |
|
|
|
|
href='#mxmlWalkPrev'><tt>mxmlWalkPrev()</tt></a> |
|
|
|
@ -226,11 +323,13 @@ href='#mxmlWalkNext'><tt>mxmlWalkNext()</tt></a>functions |
|
|
|
|
can be used to iterate through the XML node tree:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *node; |
|
|
|
|
mxml_node_t *node; |
|
|
|
|
|
|
|
|
|
node = <a href='#mxmlWalkPrev'>mxmlWalkPrev</a>(current, tree, MXML_DESCEND); |
|
|
|
|
node = mxmlWalkPrev(current, tree, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
|
|
|
|
|
node = <a href='#mxmlWalkNext'>mxmlWalkNext</a>(current, tree, MXML_DESCEND); |
|
|
|
|
node = mxmlWalkNext(current, tree, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<p>In addition, you can find a named element/node using the <a |
|
|
|
@ -238,9 +337,9 @@ href='#mxmlFindElement'><tt>mxmlFindElement()</tt></a> |
|
|
|
|
function:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *node; |
|
|
|
|
mxml_node_t *node; |
|
|
|
|
|
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "name", |
|
|
|
|
node = mxmlFindElement(tree, tree, "name", |
|
|
|
|
"attr", "value", |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
</pre> |
|
|
|
@ -249,34 +348,43 @@ function:</p> |
|
|
|
|
arguments can be passed as <tt>NULL</tt> to act as wildcards, |
|
|
|
|
e.g.:</p> |
|
|
|
|
|
|
|
|
|
<!-- NEED 4 --> |
|
|
|
|
<pre> |
|
|
|
|
/* Find the first "a" element */ |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", |
|
|
|
|
node = mxmlFindElement(tree, tree, "a", |
|
|
|
|
NULL, NULL, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
|
|
|
|
|
</pre> |
|
|
|
|
<!-- NEED 5 --> |
|
|
|
|
<pre> |
|
|
|
|
/* Find the first "a" element with "href" |
|
|
|
|
attribute */ |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", |
|
|
|
|
node = mxmlFindElement(tree, tree, "a", |
|
|
|
|
"href", NULL, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
|
|
|
|
|
</pre> |
|
|
|
|
<!-- NEED 6 --> |
|
|
|
|
<pre> |
|
|
|
|
/* Find the first "a" element with "href" |
|
|
|
|
to a URL */ |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "a", |
|
|
|
|
node = mxmlFindElement(tree, tree, "a", |
|
|
|
|
"href", |
|
|
|
|
"http://www.easysw.com/", |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
|
|
|
|
|
</pre> |
|
|
|
|
<!-- NEED 5 --> |
|
|
|
|
<pre> |
|
|
|
|
/* Find the first element with a "src" |
|
|
|
|
attribute */ |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, NULL, |
|
|
|
|
node = mxmlFindElement(tree, tree, NULL, |
|
|
|
|
"src", NULL, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
|
|
|
|
|
</pre> |
|
|
|
|
<!-- NEED 5 --> |
|
|
|
|
<pre> |
|
|
|
|
/* Find the first element with a "src" |
|
|
|
|
= "foo.jpg" */ |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, NULL, |
|
|
|
|
node = mxmlFindElement(tree, tree, NULL, |
|
|
|
|
"src", "foo.jpg", |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
</pre> |
|
|
|
@ -284,13 +392,15 @@ e.g.:</p> |
|
|
|
|
<p>You can also iterate with the same function:</p> |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
<a href='#mxml_node_t'>mxml_node_t</a> *node; |
|
|
|
|
mxml_node_t *node; |
|
|
|
|
|
|
|
|
|
for (node = <a href='#mxmlFindElement'>mxmlFindElement</a>(tree, tree, "name", |
|
|
|
|
for (node = mxmlFindElement(tree, tree, |
|
|
|
|
"name", |
|
|
|
|
NULL, NULL, |
|
|
|
|
MXML_DESCEND); |
|
|
|
|
node != NULL; |
|
|
|
|
node = <a href='#mxmlFindElement'>mxmlFindElement</a>(node, tree, "name", |
|
|
|
|
node = mxmlFindElement(node, tree, |
|
|
|
|
"name", |
|
|
|
|
NULL, NULL, |
|
|
|
|
MXML_DESCEND)) |
|
|
|
|
{ |
|
|
|
@ -298,6 +408,7 @@ e.g.:</p> |
|
|
|
|
} |
|
|
|
|
</pre> |
|
|
|
|
|
|
|
|
|
<!-- NEED 10 --> |
|
|
|
|
<p>The <tt>MXML_DESCEND</tt> argument can actually be one of |
|
|
|
|
three constants:</p> |
|
|
|
|
|
|
|
|
@ -309,7 +420,7 @@ three constants:</p> |
|
|
|
|
node or top-of-tree is reached. The previous node from |
|
|
|
|
"group" would be the "node" element to the left, while |
|
|
|
|
the next node from "group" would be the "node" element |
|
|
|
|
to the right.</li> |
|
|
|
|
to the right.<br><br></li> |
|
|
|
|
|
|
|
|
|
<li><tt>MXML_DESCEND_FIRST</tt> means that it is OK to |
|
|
|
|
descend to the first child of a node, but not to descend |
|
|
|
@ -319,40 +430,19 @@ three constants:</p> |
|
|
|
|
in the example above. This mode is only applicable to |
|
|
|
|
the search function; the walk functions treat this as |
|
|
|
|
<tt>MXML_DESCEND</tt> since every call is a first |
|
|
|
|
time.</li> |
|
|
|
|
time.<br><br></li> |
|
|
|
|
|
|
|
|
|
<li><tt>MXML_DESCEND</tt> means to keep descending until |
|
|
|
|
you hit the bottom of the tree. The previous node from |
|
|
|
|
"group" would be the "val3" node and the next node would |
|
|
|
|
be the first node element under "group". If you were to |
|
|
|
|
walk from the root node "?xml" to the end of the |
|
|
|
|
tree with <tt>mxmlWalkNext()</tt>, the order would be: |
|
|
|
|
<li><tt>MXML_DESCEND</tt> means to keep descending until |
|
|
|
|
you hit the bottom of the tree. The previous node from |
|
|
|
|
"group" would be the "val3" node and the next node would |
|
|
|
|
be the first node element under "group". If you were to |
|
|
|
|
walk from the root node "?xml" to the end of the tree |
|
|
|
|
with <tt>mxmlWalkNext()</tt>, the order would be: |
|
|
|
|
|
|
|
|
|
<pre> |
|
|
|
|
?xml |
|
|
|
|
data |
|
|
|
|
node |
|
|
|
|
val1 |
|
|
|
|
node |
|
|
|
|
val2 |
|
|
|
|
node |
|
|
|
|
val3 |
|
|
|
|
group |
|
|
|
|
node |
|
|
|
|
val4 |
|
|
|
|
node |
|
|
|
|
val5 |
|
|
|
|
node |
|
|
|
|
val6 |
|
|
|
|
node |
|
|
|
|
val7 |
|
|
|
|
node |
|
|
|
|
val8 |
|
|
|
|
node |
|
|
|
|
val9 |
|
|
|
|
</pre> |
|
|
|
|
<p><tt>?xml data node val1 node val2 node val3 group node |
|
|
|
|
val4 node val5 node val6 node val7 node val8</tt></p> |
|
|
|
|
|
|
|
|
|
<p>If you started at "val9" and walked using |
|
|
|
|
<p>If you started at "val8" and walked using |
|
|
|
|
<tt>mxmlWalkPrev()</tt>, the order would be reversed, |
|
|
|
|
ending at "?xml".</p></li> |
|
|
|
|
|
|
|
|
|