There are many Scala libraries for converting arbitrary objects to JSON and several for converting JSON to XML, but I cannot find a good way to convert arbitrary objects to XML. What is a good approach?
I used scalaxb a while ago. It works very well if you have XSD (or WSDL) as input to create your classes. If so, I also recommend using it.
Since you are also talking about JSON, perhaps you have a web application using REST. In this case, see Raise REST Support . For example, if you use one of your internal systems of constant persistence, then all your entity types get a free toXML method.
toXML
A third possibility would be to write your own transformation using Scala XML literals .
Btw possible duplicates when stack overflows: Scala XML Serialization and What is the XML serialization library for Scala?
scalaxb looks decent, I would try this first.
Source: https://habr.com/ru/post/902952/More articles:Creating a static link compared to a singleton - javaHow to keep my unit tests DRY when the mockery does not work? - c #function from one DLL calling the function of the same name with another dll - c ++How to implement Rich Text Editor in HTML? - javascriptHow to create folders in the Wiki library for SharePoint? - tfsWhat is the XML serialization library for Scala? - xmlHow to use CopyRect method in Delphi - delphiErrors using Microsoft jQuery vsdoc 1.7.1 CDN with Visual Studio 2010 - jqueryWill writing HTML with PHP echo vs writing simple HTML to cause any performance differences? - optimizationbeginSheet: block alternative with ARC? - objective-cAll Articles