Data sequence format -YAML

table of Contents

Yamla

  • YAML uses printable Unicode characters, using UTF-8 or UTF-16.
  • Whitespace indentation to indicate the file structure; however, you can not use tab character (TAB).
  • Notes started by a pound sign (#), anywhere in the row may appear, but the scope of only one line (which is generally the so-called single-line comment)
  • Each member of the list represents a single line, and with a short bar + blank (-) start. Or use of square brackets ([]), and separated by commas + blank members (,).
  • Each member of the hash table colon + Blank: separate keys and content (). Or braces ({}), and separated by commas blank + (,).
  • Key hash table can use a question mark (?) Start for more than clear that the key words composed.
    Usually quoted string not used, but when necessary, can double quotation marks ( ") or a single quote ( ') framed
  • When you use double quotes indicate a string, it can be used backslash () to start the escape character (which is similar with the C language) special characters.
  • Block string (non-essential) to indent and separated by other data and modifiers, a new row is reserved (the preserve) (using the symbol |) or a new line of folding (fLOD) (using the symbol>) in two ways.
  • In a single document, it can be used three consecutive dashes (---) differentiate multiple files.
  • Further, there is a selective number of consecutive three points (...) is used to indicate the end of the file.
  • Duplicate content can be copied from the reference marked with an asterisk (*) to the anchor tag (&).
  • Two may be used to specify the format exclamation point (!), Connected behind the name.
  • Document files can be used to guide a single instruction, the method used is the percent sign (%). There are two guidance instructions are defined in YAML1.1 version:
  • % YAML directive instruction is used to identify the version of YAML file.
  • % TAG guidance instruction, the prefix is ​​used in the URI flag. This method is quite useful when the node type tag.
  • When using YAML comma and colon must be connected behind a blank character, can be freely added or delimiter string value (e.g.: 5,280 or http://www.wikipedia.org) without the use of quotation marks.

There are also two special symbols are reserved in YAML, there are likely to be used in a future release - (@) and ( `).

Guess you like

Origin www.cnblogs.com/leafs99/p/data_serialization-YAML.html