
| Tutoial
Examples Plug-in References |
A 10 Minutes Lesson on XML Script for zeGraphzeGraph includes a special parser that recognizes predefined XML tags for creating zeGraph objects and calling their functions. The parser let you use XML as a script language to visualize data. While features of the XML script for zeGraph are not as rich as those of the Lua binding, programming involved in writing a XML script is minimal. I. 3-Rules of XMLLike HTML, XML is composed of plain text that contains tags to give meanings to the contents between them; but unlike HTML, one can define his own tags and, at the same time, have to interpret those tags in one way or another. You only have to remember three XML rules in writing a script for zeGraph:
You may use MS explorer to verify XML format. For that purpose, please use <?xml version="1.0" encoding="ISO-8859-1" ?> as the first line. For more details on XML format, please refer to http://www.w3schools.com/xml/ and http://www.xml.com/. II. A Simple Example
<ze_graph>
<ze_render>
<size>300, 300</size>
<ze_scene>
<ze_node name="root">
<ze_polygon>
<type>triangles</type>
<ze_vertex>
<append>
-100, -100, 0, 100, -100, 0, 0, 100, 0
</append>
</ze_vertex>
<ze_color>
<append>
0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1
</append>
</ze_color>
</ze_polygon>
</ze_node>
</ze_scene>
<show>any</show>
</ze_render>
</ze_graph>
III. 9 Rules of XML Script for zeGraph
IV. <include> and <use>The <include> tag allows you to load scripts from other files. You can use this feature to load fine-tuned parts of script to the current script. The <use> tag make any named object as the current object and then any function call refers to the object. V. Data File FormatData to be imported from a text file must be formated as follows:
VI. Learn From ExamplesA 10 minutes lesson can't cover everything. Look into the examples for more uses of XML Script for zeGraph. VII. Execute Script |