It's hard to say for sure, not knowing exactly which XML you want to convert and how, but, as the situation stands, the XSLT template / match is more powerful and readable than Scala XML template matching, which has a number of problems.
In particular:
- any nontrivial comparison is either impossible or very difficult to do
- namespaces are not supported
Thus, you might be better off calling Saxon from Scala to perform these conversions.
However, you can see the XML chapter from Scala programming.
Finally, the common belief these days is that Scala's native XML support is missing in many ways. See Anti-XML for a project whose goal is to create something better.
source share