scala-xml

Scala: Given a scala.xml.Node, what's the most efficient way of getting the second (or n-th) child element?

Given a scala.xml.Node object (with white space and elements as child nodes) what's the most efficient way of getting the second (or n-th) child element? Usually I would go for the built-in (node \ "foo"), but sometimes I have to rely on the position of the element. For example, I could have two Choice groups that could be either foo or...

Scala XML retrieving from optional paths

I'd like to process a document to retrieve a value that could have more than one path. The ideal signature would look something like: def value(doc: Elem, potential_paths: List[something]): String Where it would simply process the doc looking at the head of the potential_paths, if found, return it, otherwise continue with potential_p...