Implicit conversions to make using the XOM XML library easier from Scala, and to make using Saxon's XPath 2 support easier
inigo/scala-xom
master
Name already in use
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Scala implicits to make using the XOM XML library easier in Scala, and to make using Saxon's XPath 2 support easier. Usage ----- import net.surguy.xom.Implicits._ import scala.xml._ // Create Scala XML objects as normal val scalaXml = <root>Some text about <b>XML</b> and <b>other things</b></root> // Convert them to XOM val xomXml = scalaXml.toXom // Use XPath 2 from Saxon against them val foundNodes = xomXml.selectNodes("//b[matches(.,'X.*')]") // Use Scala iterators with XOM xomXml.elements.foreach( _.addAttribute(new nu.xom.Attribute("new","value")) ) // Convert XOM to Scala xomXml.toScalaXml Note that the conversion from Scala XML to XOM, and from XOM to Saxon's OM, is not hugely inefficient but any process that converts XML between formats multiple times is not going to be particularly performant. Build and dependencies ---------------------- This library depends on XOM and on Saxon-B. It should also be compatible with Saxon-SA. It is not compatible with the latest version of Saxon, Saxon-HE, which has removed support for models like XOM. This library can be built with Maven or with SBT. Licensing --------- This code is under the Apache software license, version 2. See http://www.apache.org/licenses/LICENSE-2.0 for the full license. This code uses the XOM XML library from Elliotte Rusty Harold, available at http://www.xom.nu/, and licensed under the LGPL. It also uses the SAXON XSLT Processor from Michael Kay, available at http://saxon.sourceforge.net/, licensed under the MPL 1.0.
About
Implicit conversions to make using the XOM XML library easier from Scala, and to make using Saxon's XPath 2 support easier