By Alvin Alexander. Last updated: January 17, 2017
The following links are a collection of Scala XML tutorials I've written. Most of them come from the Scala Cookbook, while the others were written before I wrote the Cookbook.
Without any further ado, here are the links:
- How to create XML literals in Scala code
- How to generate dynamic XML
- "Pretty Printing" XML
- How to save XML to a file
- How to serialize and deserialize XML
- How to read/load XML from a file
- How to read/load XML from a URL
- Searching XML with XPath
- Searching XMLNS namespaces with XPath
- How to extract data from XML nodes (also covers Java "Out of Memory" REPL errors)
- How to extract data from arrays of XML nodes
- Extracting information from XML tag attributes
- Using Scala match expressions with XML
Here are a couple of smaller Scala/XML tips I wrote:
And here's a link to some large sample XML datasets at washington.edu:
As usual, I hope these are helpful.
All the best,
Al