Quantcast
Viewing all articles
Browse latest Browse all 25

Scala: Extracting data from an array of XML elements

Problem: Your XML data has an array of elements, and you need to extract the first element, second element, or more generally, the Nth element, using Scala.

Solution

The following simplified version of the XML from the Yahoo Weather API has three <forecast> elements:

read more


Viewing all articles
Browse latest Browse all 25

Trending Articles