Add Scala and Java APIs for unparsing
- Modify Scala and Java APIs to support unparsing
- Modified Scala/Java API tests to round trip tests where possible.
Additionally, many tests were modified to clean up unused code to make
the tests seem less cluttered
- Revealed an issue in the Java API where we double HTML-escaped the
data. This resulted in things like < in the data, instead of
just <. This happened because when creating a JDOM2 documented, we first
convert the infoset to a scala.xml.Node, then convert that to JDOM2.
Scala escape the data, and then JDOM escaped the data again. The
solution is to just get the raw data out of the scala Nodes and
provide those to JDOM.
- Slightly change the logic for converting CRLF to LF. The way we had
it, when writing to XML, it would convert CRL to LF correctly. But
when reading XML that contained CRLF, it would be converted to CR.
Fixing the logic resolves this issue.
- Change InfosetCursor.fromXMLNode to create and XMLEventCurosr rather
than using elem2Element. The elem2Element function aborts if the scala
xml does not match the infoset. We need to report SDE's if they do not
match, so instead use XMLUtils.nodeToXMLEventCursor to convert the
node to an XMLEventCursor, which is then used to create an
InfostCursor.