Hi Marco, Hans-Jürgen, Martin, Fabrice,
I had a look at the YAML spec [1], and I noticed it’s somewhat more bulky than the JSON spec [2]. In addition, I checked out the YAML to XML conversion of FasterXML. It seems to handle the basic cases, but e.g. cannot process lists, comments or references. Maybe I’m not properly using it, though. I have attached a very basic Eclipse project for those who want to have a closer look.
My guess is that there is no existing implementation of the official XML binding draft available [3] (and it might be interesting to find out why before we follow this path). Has anyone of you already worked with XML representations of YAML?
Best, Christian
[1] https://yaml.org/spec/1.2/spec.html [2] https://tools.ietf.org/html/rfc8259 [3] https://yaml.org/xml
On Wed, Aug 12, 2020 at 7:21 PM Christian Grün christian.gruen@gmail.com wrote:
Hans-Jürgen, thanks for you assessment. I see that there may be no real need for a JsonML equivalent for YAML. And my assumption is that the binding from yaml.org my be the most appropriate solution for now. Similar to our JSON mapper, it uses underscore element names to represent arrays.
Hans-Juergen Rennau hrennau@yahoo.de schrieb am Mi., 12. Aug. 2020, 18:59:
Remark: support for a roundtrip-able XML representation of YAML would consolidate BaseX's great position as a data integration platform, further increasing the number of continents (mediatypes) which can be travelled on the highway of XPath (XML, JSON, CSV, HTML, YAML).
In comparison, I think, YAML representation of arbitrary XML would be a nicety without strategic significance.
Hans-Jürgen
Am Mittwoch, 12. August 2020, 18:38:10 MESZ hat Christian Grün christian.gruen@gmail.com Folgendes geschrieben:
I was wondering if you can successfully serialize any arbitrary XML document to a YAML representing, ideally without losing information (attributes, comments, etc.), and convert the result back to the original XML representation.
I would guess that YAML to XML conversions is easier.
Apart from that, it would surely be possible to write a little XQuery module that performs all the conversions (just a matter of time?).
Marco Lettere m.lettere@gmail.com schrieb am Mi., 12. Aug. 2020, 18:31:
@Marco: Do you know which conversions are provided by FasterXML: arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying conversion rules are promising, we could include them a 'fasterxml' format in BaseX (similar to the 'jsonml' format).
As far as I can understand from the docs and the code on github there Jackson is a sort of hub with several dataformat modules which are able to parse and serialize from the various formats.
I don't know whether, with the term arbitrary, you mean to be able to provide your own syntax for the XML serialization. In this case I am not sure.
M.