scala/scala — pull request #4218 by som-snytt (2014-12-21 20:35:28+00:00)
Title: SI-3368 CDATA gets a Node

XML Parser uses `scala.xml.PCData`.

A compiler flag `-Yxml:coalescing`, analogous to
`DocumentBuilderFactory.setCoalescing`, turns `PCData`
nodes into `Text` nodes and coalesces sibling text nodes.

This change also fixes parse errors such as rejecting a
sequence of CDATA sections.

A sequence of "top level" nodes are not coalesced.

```
scala> starthi & byeworldstuffred & black
res0: scala.xml.Elem = starthi & byeworldstuffred & black

scala> :replay -Yxml:coalescing
Replaying: starthi & byeworldstuffred & black
res0: scala.xml.Elem = starthi & byeworldstuffred & black
```