Richard Searle


How not to extend Scala XML

06 Sep 2010

The first step in considering how to better integrate Scala and Java XML processing is a Google search to find the prior art. That found the following gem. The scala.xml.Elem is prettyprinted to a String and then parsed into a DOM for processing by the Java xpath implementation. This code illustrates a common concern with tools that hide the implementation details; they often hide significant performance problems. It might be argued that Scala implicit conversions will make this anti-pattern a common occurrence.