ABSTRACT

This chapter deals with parsing XML data. While the for loop is a counter, the “for in” loop iterates through properties or, as shown in our example, through the elements of an array. Attributes in XML are used to provide additional information. They belong to nodes and are strings and, therefore, need to be flanked by quotation marks. Because attributes are easier to access than nodes some developers like to create XML files with few nodes and many attributes. XML files with namespaces play a more important role than ever, because they contain unique identifiers. The question is if they are different with regard to parsing from regular XML files. The answer is that basically they are the same but there are a few instances in which we need to be careful and use syntax different from parsing regular XML files.