-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore different characters for XML attributes #74
Comments
Thanks for the suggestion. I have a hard time believing that there are a lot of use cases for converting XML to YAML. I'd probably be OK with adding an option for configuring this (I'm not OK with changing the default). |
@kislyuk thanks, I dont do a lot of XML => YAML conversion, but I noticed that XML can be more expressive since it has attributes. JSON and YAML dont, but you can fake them in different ways. It is interesting to see how different people represent XML as JSON or YAML. |
This is with reference to #74 (comment) |
Hi @ksridhar - there is no command line option to customize this behavior. PRs are welcome. |
When it comes to XML attributes, XQ prepends with
@
:my issue is that with YAML
@
requires quoting:Other characters are available that dont require quoting, for example:
Here are others:
To counter myself, some would point to this page:
https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
Which is referenced by multiple repos:
Further as
@
represents the "at sign", it is similar to "attribute" and soeasy to remember. However I would make a couple of points. The xml.com page
above has no mention of YAML, and as such I think its validity is weakened in
regards to a YAML repo. Futher, I think it would be helpful to use a character
that "plays nice" or is the "least bad" across XML, JSON and YAML, and
that is not the
@
character.Ideally I would say the default should be changed to
$
or similar, but if thedefault stays and an option is added to XQ, that would be acceptable as well. I did find these documents in support of
$
character:The text was updated successfully, but these errors were encountered: