This repository was archived by the owner on Jun 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.html
122 lines (99 loc) · 3.42 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
---
layout: withcc
title: XMLElement | reference
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>XMLElement</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><pre>// The following short XML file called "sites.xml" is parsed
// in the code below. It must be in the project's "data" directory
// <?xml version="1.0"?>
// <websites>
// <site id="0" url="processing.org">Processing</site>
// <site id="1" url="mobile.processing.org">Processing Mobile</site>
// </websites>
XMLElement xml;
void setup() {
size(200, 200);
xml = new XMLElement(this, "sites.xml");
int numSites = xml.getChildCount();
for (int i = 0; i < numSites; i++) {
XMLElement kid = xml.getChild(i);
int id = kid.getInt("id");
String url = kid.getString("url");
String site = kid.getContent();
println(id + " : " + url + " : " + site);
}
}</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p>XMLElement is a representation of an XML object. The object is able to parse XML code.
The methods described here are the most basic.
More are documented in the <a href="http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/index.html">Developer's Reference</a>.</p><p>The encoding parameter inside XML files is ignored, only UTF-8 (or plain ASCII) are parsed properly.</p>
</td>
</tr>
<tr class="">
<th scope="row">Methods</th>
<td><table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getChildCount_">getChildCount()</a></th>
<td>Returns the number of children for the element.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getChild_">getChild()</a></th>
<td>Returns a single child.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getChildren_">getChildren()</a></th>
<td>Returns all of the children as an XMLElement array.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getContent_">getContent()</a></th>
<td>Returns the content of an element.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getIntAttribute_">getIntAttribute()</a></th>
<td>Returns an integer attribute of the element.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getFloatAttribute_">getFloatAttribute()</a></th>
<td>Returns a float attribute of the element.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getStringAttribute_">getStringAttribute()</a></th>
<td>Returns a String attribute of the element.</td>
</tr>
<tr class="">
<th scope="row"><a href="/reference/XMLElement_getName_">getName()</a></th>
<td>Returns the name of the element.</td>
</tr>
</table></td>
</tr>
<tr class="">
<th scope="row"><!--*-->Constructor<!--*--></th>
<td><pre>XMLElement(<kbd>parent</kbd>,<kbd>file</kbd>)</pre></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td><table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">parent</th>
<td>PApplet: typically use "this"</td>
</tr>
<tr class="">
<th scope="row">file</th>
<td>String: name of the XML file to load
</td>
</tr>
</table></td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
</table>