Specifying fields by using XPath notation
If you intend to read or write XML structures, it's mandatory that you understand at least the basics of XPath, the language for finding information in an XML document, or defining parts of an XML document. In this recipe, you will be introduced to the XPath notation, so that you will find it easier to work with the rest of the recipes in the chapter.
Suppose you have an XML structure such as the following:
<w_cond> <data> <request> <type>City</type> <query>Buenos Aires, Argentina</query> </request> <current_condition> <observation_time>08:12 PM</observation_time> <temp scale="C">19</temp> <temp scale="F">66</temp> <weatherDesc>Sunny</weatherDesc> <windspeed unit="Miles">8</windspeed> <windspeed unit="Kmph">13</windspeed> <dirDegree>70</dirDegree>...