How does YAML represent XML attributes?



How can I convert this XML to YAML and back again without losing information?



<foo bar='one' baz='two'>Lorem Ipsum</foo>


My best guess is something like this, but it looks too verbose to me:



foo:
attr:
- bar: one
- baz: two
value: Lorem Ipsum


Second question: Is there syntax similar to this for attributes in YAML?



foo ( bar: one, baz: two ): Lorem Ipsum

No comments:

Post a Comment