Javaeye http://angeloce.iteye.com/admin/blogs/385976
========================================================== ============
Yaml is an intuitive data serialization format that can be recognized by computers. It is easy for humans to read and
YAML Pre-research document YAML OverviewYAML is a recursive abbreviation for "Yaml Ain t a Markup Language" (Yaml is not a set-up language), and the previous yaml means "yet another Markup Language" (another kind of labeling language), But in order
1, example 11.1, Yaml file contents are as follows:host: localhost:3306user: rootpwd: 123456dbname: test 1.2, the code is as follows: //Convert the Yaml file to an object and convert it to JSON format to output the package Mainimport
Recently processed some configuration files, encountered in the YAML format of the file, because no previous contact with this format file, for XML is more familiar. So what is YAML? What are the advantages and disadvantages of it compared to XML?
Yaml is an easy to read, suitable for Presentation program language data structure, can be used to exchange data between different programs, support generic tools, support serial processing, rich expression capabilities and scalability, Easy-to-use
1. What is YAML?
Official website explanation
%YAML 1.2---YAML: YAML Ain't Markup LanguageWhat It Is: YAML is a human friendly data serialization standard for all programming languages.
2.yaml syntax
Yaml syntax, please refer to this man's, written
Atitit. Selection of manual configuration list files and data hierarchy Attilax summarize best practices --yaml1. Yaml is a good choice : 12. Hierarchical structure of data-structure:hash,list, and block literal. 13. Yaml differs from JSON
Basic rules
YAML has the following basic rules:
1, Case sensitive
2. Use indentation to represent hierarchical relationships
3, prohibit the use of tab indentation, you can only use the space key
4. There is no limit to the indentation length, as
Serialization in. NET is usually in binary or xml format. After ajax emerged, the JSON format is also used, which is rare compared with YAML.
BinaryCannot be directly read. It must be decoded at the binary level;The format is defined by the vendor.
Directory[TOC]One, Yaml introductionYAML full name yet another Markup Language (another markup language). Using YAML as a configuration file, the file looks intuitive, concise, and easy to understand. Yaml files can parse the data structures of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.