Various XML fixes.

Add tests for bug 2487, exploring the situations where "]]>" is and isn't
allowed. Fix the bug by changing KXmlParser so it pays attention to
whether it's dealing with normal text or text in an attribute value and
reports errors appropriately.

In order to pass the new tests, we also need to fix DocumentBuilder to
pay attention to its DocumentBuilderFactory's "coalescing" setting: whether
or not adjacent text/CDATA nodes should be coalesced.

This in turn fixes a @KnownFailure in DocumentBuilderFactoryTest: previously
we didn't allow the caller to turn "coalescing" off (though until my
previous patch, we didn't actually coalesce anyway). Now we support both,
and I've made coalescing the default, because bug reports tell us that's
what users want. It's how the RI behaves, too.

Bug: 2487
6 files changed