The first language to be used for XML parsing is Ruby. Ruby appears to have three main XML libraries: REXML, Hpricot, and libxml-ruby. As time allows, each will be tested.
Before starting the testing, several things need to be done. First, there needs to be a representation of the Item class in Ruby. From the pseudocode initially shown in the problem statement, I derive the Ruby representation of the Item class and its helper classes.
Since no limitations have been set for accessing or modifying the object's data, all fields are implemented with attr_accessor. Unfortunately, since attr_accessor does not have the ability to set default values, the variable initialization needs to be done in the constructor.
One notable difference between the pseudocode and the Ruby version is the casing. While the pseudocode uses "camel case" variable names as standard for Java, the Ruby version uses "underscore" variable names as per the conventions of the community. This creates small differences like critRating vs. crit_rating. There is an ongoing debate as to which is easier to read.
This represents the bare minimum thus far needed to implement the Item object. When discussing testing, other methods will be added to the Item class and helper classes.
World of Warcraft is an enormously popular MMORPG. Recently, Blizzard Entertainment announced that they had surpassed 11.5 million subscribers worldwide.
One of the many services offered by Blizzard Entertainment is the Armory which allows players to view their characters and others online. Items are also searchable through a recent update. All of the dynamic content (characters and items) are served as XML content which is then passed through XSL stylesheets to present the HTML content. This allows those who have the interest to query the Armory for the XML representation of an item or a character and then parse it locally.
Write an XML parser that processes an item's XML data and generates a data representation of that item.
While trying to decide how to approach a given project a few weeks ago, I had the choice of using one of several programming languages. This prompted me to look around for ideas of what other people had said comparing languages.
In my opinion, the best comparison I found was David Howard's essay C++ vs Java vs Python vs Ruby : a first impression. While mostly devoid of bias, what really won me over was the ability to compare the implementations of his example matter, a "Red-Black tree algorithm."
Fortunately, for me, the project I was working on did not need anything spectacular for a user interface or deployment. However, most "real" projects are limited by some requirement based around usage or target audience. Writing custom web applications is usually limited by the abilities of the target webserver. Writing applications for deployment on desktop machines is limited by the support for the target OS and its GUI in the programming language or libraries. Writing applications for deployment on a security-audited machine can require the application only being able to use what is already installed.
Since I do not plan to be limited to a particular platform, application, etc. in the future, I find it behooves me to learn how to implement tasks (some "real-world", some "toy") in various languages (and, in some instances, various libraries within the languages). Each implementation will have its own article and will be written with my thoughts as I go. (Or that's the intention anyway.)
By posting what I come up with publicly, I hope to help others looking to fulfill these tasks and I hope to get people more knowledgeable than I to comment on what I've done wrong.