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.gr...@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 <hren...@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.gr...@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.lett...@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.
>>

<<attachment: jackson.zip>>

<LinkedHashMap>
  <number>34843</number>
  <date>2001-01-03</date>
  <bill-to>
    <given>Chris</given>
    <family>Dumars</family>
    <address>
      <lines>458 Walkman Dr.
 Suite #292
 
</lines>
      <city>Royal Oak</city>
      <state>MI</state>
      <postal>48046</postal>
    </address>
  </bill-to>
  <ship-to>id001</ship-to>
  <product>
    <sku>BL394D</sku>
    <quantity>4</quantity>
    <description>Basketball</description>
    <price>450.0</price>
  </product>
  <product>
    <sku>BL4438</sku>
    <quantity>1</quantity>
    <description>Super Hoop</description>
    <price>2392.0</price>
  </product>
  <tax>251.42</tax>
  <total>4443.52</total>
  <comments>Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338</comments>
</LinkedHashMap>

Attachment: invoice.yaml
Description: Binary data

Reply via email to