xml - Simpler than YAML, better than CSV -


i need simple input language customers' needs. among know (xml, json, yaml, csv), xml , json can't used ("not damn human-readable").

csv simple tasks (there hierarchies, , attributes maybe attached "items")
, yaml complicated. ("documentation? tl;dr")

is there known standard can fill gap between yaml , csv? or i'll need myself?

the question arose because have no time reinvent wheels.

upd: (after discussion)

my "language" should similar csv, not simple.
there definition (schema, template, pattern) of tree structure (somwhere, it's not deal).
have define human-readable language it's data storage.

informal examples of various "patterns":

class -> kind -> species   menu -> submenu -> sub-submenu panel -> subpanel -> control 

examples of corresponding content

animals [cat, dog, elephant {big, gray}], plants [deciduous [oak, maple, baobab],       other [fir, cactus] ]  file [new, open, save, remove {disabled}], view [text [ansi {default}, utf-8],      binary, html], [on-line, forum, about]  header {height:10} [welcome, controls [help button, search pane]], main [teaser, news, articles [1, 2, ..., n]], footer [status bar [?, ?], powered by, copyright notice {color: gold}] 

so preliminary definition of required language is:

nodes delimited ',' (comma) or \n (line feed) node may have optional set of attributes (in curly brackets) node may have optional set (array) of subnodes (in square brackets) 

if there similar in world in use should see avoid pitfalls.
otherwise should patent new ingenious language))

there rfc published configuration files.

the format looks this:

[mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid skip-external-locking old_passwords = 1 skip-bdb skip-innodb 

it works this:

[section_name] my_variable = my_value 

you can have multiple sections, , each of them can have many variables want. it's not powerful json or xml since can have more 1 nested elements, work around this:

[section1] my_var = 2  [section2] parent_section = section1 my_other_var = 3 

of course, have write code deal use case, keeps syntax pretty clear, , depending on needs format might enough.

i don't know language you're going use, there implementation in python (and in languages)

it gives human readable, easy parse, , pretty powerful.

edit: example coming python documentation (see link above).


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -