State of XML support in Scala 2.9.x

↘锁芯ラ 提交于 2019-11-30 08:16:58

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.

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

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.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!