Q5: What tools (specifically parser) do you use and what are their advantages?

What type of parser (SAX, DOM, etc.) did you use for your project? Was this parser commercially available, or did you build it? Why did you choose this parser, and were there any particular advantages or disadvantages to it?


JMM: I wrote my own ad hoc XML processor in Java, based on DOM4J. It is open source. I chose it because it easily integrates with Java in the Eclipse IDE.

MG: Usually SAX (for in-game use) but sometimes DOM (usually for tools used internally). At EA we use a parser written internally. At FIEA we use an open source parser called Expat. At EA we have to use software developed internally or for which we have obtained licenses. The process of obtaining a license is cumbersome and we generally need to modify source code so that we can control the memory footprint since most games ship on fixed memory systems. At FIEA we have more limited resources and Expat serves our needs adequately.

TG: Being a flash project, there are a few ways to parse the data. Flash 8 and earlier (ActionScript 2.0) has an awkward way of parsing XML information, so I normally rely on a custom class called XMLConstruct made for ActionScript 2.0, however Flash 9 (ActionScript 3.0) has built in functions to parse XML, including the E4X library. The aforementioned XMLConstruct class was created by a group of developers at indivision.net. The ActionScript 3.0 parser is built in to the new Flash CS3 commercial software

Using the XMLConstruct parser is extremely advantageous in that it allows you to refer to a specific XML element (also known a “node”) by name, as opposed to by number. For example, without the XMLConstruct class, to refer to an element, it would look something like this:

myNode = myXML.childNode[0].childNode[1].nextSibling;

using the XMLConstruct class, the same result could be attained thusly:

myNode = myXML.trivia[0].question[1].answer;

BA: We use the SAXON processor with our home-grown XSLTs to convert our raw XML into either finished HTML files or text files (snippets) that are brought into generating HTML files later in the process. We also use Innovasys Document! X to automatically generate a lot of HTML documentation of the product. We then compile the automatically generated HTML along with the XML-to-HTML files of human-authored content to make a complete compiled online help system for our customers.

SS: Our authoring environment is furnished by the government. The environment includes a built-in editor, parser, reader, and style sheet editor. These tools are basic; they don't include many of the convenient functions found in high-end commercial authoring environments. They work well, but the author needs to know the document markup language and structure fairly well in order to make the tools efficient.




Return to the List of Questions.