Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
C HAPTER 28 ยท Working with XML Notice all of the lines that try to process white space as if it were a true thermometer record. What you would really like to do is ignore the white space and process only those sub-nodes that are inside a <cctherm> element. You can describe this subset using the pattern <cctherm>{_*}</cctherm> , and you can restrict the for expression to iterating over items that match that pattern: catalog match { case <catalog>{therms @ _*}</catalog> => for (therm @ <cctherm>{_*}</cctherm> <- println("processing: "+ (therm \ "description").text) } therms) processing: hot dog #5 processing: Sprite Boy 28.9 Conclusion