Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by ams6110 on Sunday July 31, 2016 @02:32PM
(#12198175)
>YAML, which most people would never think of outputting as templates
Don't tell the Ansible folks!
Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by geerlingguy on Sunday July 31, 2016 @05:26PM
(#12198964)
Ansible uses Jinja2 to output templates in whatever format is preferred by the thing being configured. I haven't personally seen Ansible used to output YAML... But people will do anything :-P
Ansible does use YAML as a configuration language though—something for which it's perfectly suited.
Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by spdionis on Sunday July 31, 2016 @05:55PM
(#12199096)
Well, some frameworks use yaml for config files and you might use ansible to write those.
That said the templating is usually trivial, just maybe write some string values.
Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by cytzol on Monday August 01, 2016 @03:13AM
(#12200675)
I’ve done it. It’s painful enough that it teaches you “don’t do this!”. For example, you need to escape `{{ item }}` as `{{ "{{" }} item {{ "}}" }}`!
Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by flomo on Sunday July 31, 2016 @04:16PM
(#12198631)
Outputting JS as templates or printed text was pretty common before every language added a handy toJson method though.
Re:How to Avoid Being Called a Bozo When Producing XML (2005)
by nrser on Monday August 01, 2016 @08:36AM
(#12201853)
yeah, I guess I sorta missed that... I mean the 'X' in AJAX was for XML... I've def been guilty of outputting "XML" with php tags. by the time we got to JSON there were libs available, or maybe we just wrote our own.
you come from web dev doing HTML like that and you see XML and think "hey, that looks the same, i'll do it in the same way".
XML is a programmatic data exchange format like JSON or YAML, which most people would never think of outputting as templates or printed text, but it looks and feels like HTML, which most people deal with first and where that's the standard approach.