YAML : Basic Understanding
YAML : Basic Understanding
Yet Another Markup Language (YAML)
What is YAML :?
YAML is a human-friendly data serialization language for all programming languages. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Extensible Markup Language but has a minimal syntax that intentionally differs from SGML.
Syntax:
· YAML accepts the entire Unicode character set, except for some control characters, and maybe encoded in any one of UTF-8, UTF-16 or UTF-32.
· Whitespace indentation is used for denoting structure; however, tab characters are not allowed as part of that indentation.
· Comments begin with the number sign (#), can start anywhere on a line, and continue until the end of the line. Comments must be separated from other tokens by whitespace characters. If # characters appear inside of a string, then they are number sign (#) literals.
· List members are denoted by a leading hyphen (-) with one member per line.
· An associative array entry is represented using colon space in the form key: value with one entry per line. YAML requires the colon be followed by a space so that scalar values such as http://www.wikipedia.org can generally be represented without needing to be enclosed in quotes.
· Strings (one type of scalar in YAML) are ordinarily unquoted, but may be enclosed in double-quotes ("), or single-quotes (').
· Block scalars are delimited with indentation with optional modifiers to preserve (|) or fold (>) newlines.
· Multiple documents within a single stream are separated by three hyphens (---).
· Repeated nodes are initially denoted by an ampersand (&) and thereafter referenced with an asterisk (*).
· Nodes may be labeled with a type or tag using a double exclamation mark (!!) followed by a string, which can be expanded into a URI.
· YAML documents in a stream may be preceded by 'directives' composed of a percent sign (%) followed by a name and space-delimited parameters. Two directives are defined in YAML 1.1.
Key Feature of YAML are :
1)Indented delimiting
2)Non-hierarchical data models
3)Practical considerations