what is the use of pipe symbol in yaml -


I'm new to Yamal, and I have a question. Pipe symbol (|) is used for multiple lines. Does Yaml have the following one like any syntax?

Examination: | 6 +

I is a yaml code in two ways, the first one is working and the other is not. I do not know what was happening there
First file

  name: - test: well 1 - second: val 2 - third: val 3 - then - Last: | An AA aaaa: 'test:'   

second file

  name: - test: val 1 - second: Val 2 - Third: Val 3 - Then - Final: | 6+ Aaaa: 'test:'   

PS: The second file is of the customer I am using xmlbeans and I "com.esotericsoftware.yamlbeans. Parser.Parser $ ParserException: Line 17, column 12 is found: A 'block end' was expected, but found: Block mapping started ".

Edit XMLBines have been added

>

The pipe symbol at the end of a line in YAML indicates that any indented text should be interpreted as multi-line scalar value. See. Specifically, the pipe indicates that scalar values ​​(except for indentation) should be literally done in a manner that preserves new lines. Conversely, & gt; The character indicates that the multi-line "fold" scalar is low, which means that new lines are converted to blank space, for example:

  & gt; & Gt; & Gt; Import Yum & gt; & Gt; & Gt; Yaml.load ("" ... | ... this is a multi-line ... lexical style scaler ... "" ") 'This is a multi-line \ nliteral-style scaler. \ N' & gt; & Gt; & gt; Yaml.load ("" ... ... gt; ... this is a multi-line ... curved scaler ... new lines ... are empty ... empty Location ... "" ") 'This is a multi-line domed scaler; New rows are added to the empty space. Particular indication of how much of the line of indentation should be used. "Chomping indicator"  + \ n \ n '  

6 + With , which governs the way the scalar literally controls the extra whiteness in the end.

The error you are getting is difficult: This is because indentation should be relative to the existing block-level element. Therefore in this case it should be 6 + instead of 4 + because the element of the last block-level is the array object (specified by - ) and Literally 4 to indent. Some surprisingly final: | Mapping is not considered a block element even if its value is multi-queued. If you think about it then it makes sense in one way - it's still a 'one-liner' "key: price" mapping. The value is to use special syntax for multi-line scalar values. Misleading, but somehow compatible ...

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -