State of XML support in Scala 2.9.x
Asked Answered
C

4

18

I'm currently starting to look into using Scala's XML support for business critical processes. In that regard I would like to know what the current state of the standard XML library in Scala is.

I have read some "old" articles relating to Scala 2.7 and the 2.8 trunk, where it was stated that the XML handling would be threadsafe for scala 2.8, and that there was several bugs in version 2.7.x. Some critique has also been giving on the XML class hierachy, but I guess that's a matter of taste.

So I would like if somebody could answer the question, what is the current state of the Scala XML library for version 2.9.x?

Thanks in advance.

Clearsighted answered 27/9, 2011 at 12:33 Comment(1)
See also: github.com/djspiewak/anti-xmlAyo
S
10

Let me answer this way:

Or, putting it into words, many people are not satisfied. After all, people are writing full blown alternatives instead of trying to "fix" the library. And, speaking of fixing, I had a fix which turned an operation from O(n^2) to O(n) submitted for so long that, when someone opened the very same issue again, I didn't even remember having opened it before.

Mind you, Lift uses standard library XML, and, as far as I know, so do most of the other web frameworks (I suspect Play doesn't), so it's not like it's unusable.

Susian answered 28/9, 2011 at 1:3 Comment(2)
I heard that scala.xml will be eliminated since Scala 2.11. Is that so?Inept
The links are rotten - they can be followed, but they no longer show the intended content.Ruysdael
F
13

There is an alternative library available for XML in Scala, Anti-XML. From the home page:

Anti-XML is a proposed replacement for the scala.xml package in the Scala standard library. The standard package is outdated and beyond fixing. We need to start over, on solid foundations and unburdened by backward compatibility. Anti-XML aims for quality in three major areas: Usability, Reliability, Performance

If you're looking at using XML seriously, then it's worth looking at Anti-XML.

The source is available here: https://github.com/djspiewak/anti-xml

Freshwater answered 27/9, 2011 at 12:43 Comment(0)
S
10

Let me answer this way:

Or, putting it into words, many people are not satisfied. After all, people are writing full blown alternatives instead of trying to "fix" the library. And, speaking of fixing, I had a fix which turned an operation from O(n^2) to O(n) submitted for so long that, when someone opened the very same issue again, I didn't even remember having opened it before.

Mind you, Lift uses standard library XML, and, as far as I know, so do most of the other web frameworks (I suspect Play doesn't), so it's not like it's unusable.

Susian answered 28/9, 2011 at 1:3 Comment(2)
I heard that scala.xml will be eliminated since Scala 2.11. Is that so?Inept
The links are rotten - they can be followed, but they no longer show the intended content.Ruysdael
R
2

Scala XML is stable, supported and won’t go away for a very long time.

Nonetheless, there are some design criticisms made and a few people sat down and decided to write a better alternative from scratch, Anti-XML.

If everything works out, you will have an additional choice in the future.

Risinger answered 27/9, 2011 at 17:46 Comment(0)
A
2

Scales Xml is my answer to that question. Its not that I had found the quirks of Scala XML to be bad, but the approach itself didn't sit with me well and prompted the question "what if you separated the content from the tree and unified push and pull".

After much playing I discovered many cool ways to leverage the type system in order to make XML usage simpler for a number of activities, more correct and faster than Scala XML.

You very quickly realise, when writing an alternative library, just how much thought and effort went into Scala XML. Its killer features are:

  1. Provided with the default library
  2. In built XML syntax

for simple out of the box usage its hard to beat (although I'm confident I've done that ^_^).

Its important that other younger alternatives like Anti-XML have appeared as choice is often what drives innovation. I'd just advise users to look at what they really need rather than assuming the alternatives automatically provide the best choice.

Agon answered 5/11, 2011 at 19:21 Comment(2)
This seems no longer maintained for Scala 2.11 - is it no longer necessary, or is this lack of interest / time / ...?Ruysdael
In case anyone finds this, I just pushed 0.6.0-M4 for 2.11,2.12 and 2.13. The gap in updates was due to limited time and priorities, a need for a good 2.12 xml lib changed those priorities.Agon

© 2022 - 2024 — McMap. All rights reserved.