Sunday 3 June 2018

What is the use of the pipe symbol in YAML?

I am new to yaml, and I have a question about the pipe symbol (|) used for multiple lines. Does YAML have any syntax like the one below?





test: |6+




Of the two YAML files below, the first one is working and second is not. I do not know what is causing this.



First File



Name :
-
testing:

val1
-
second:
val2
-
third:
val3
-
then
-

final: |
a
aa
aaa
aaaa : 'test:'


Second File



Name :

-
testing:
val1
-
second:
val2
-
third:
val3
-

then
-
final: |6+
a
aa
aaa
aaaa : 'test:'


The second file is the customer's.




I am using XMLBeans and I get this error:




com.esotericsoftware.yamlbeans.parser.Parser$ParserException: Line 17, column 12: Expected a 'block end' but found: block mapping start".


No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...