2 <title>Yaml Test
</title>
5 <table border=
1 cellspacing=
0>
8 <script src=
"../../lib/CGI/Ex/yaml_load.js"></script>
11 if (! document.yaml_load) {
12 document.writeln('
<span style=
"color:red"><h1>Missing document.yaml_load
</h1>Path to ../../lib/CGI/Ex/yaml_load.js may be invalid.
</span>');
14 document.writeln('
<span style=
"color:green"><h1>Found document.yaml_load
</h1></span>');
21 <tr><th colspan=
2>YAML text
</th></tr>
25 var yaml = "--- #YAML:
1.0\n\
27 foo2: {key1: val1, key2: 'value
2'}\n\
33 - 'with the last item being a long string'\n\
34 foo4: [another, list, of, values]\n\
37 that is on multiple lines.\n\
47 multiple lines and is folded.\n\
52 multiple lines and is folded.\n\
53 foo7: 'singlequoted''with embedded quote'\n\
54 foo8: \"doublequoted\\\"with embedded quote\"\n\
64 <th>Produces
</th><th>Should look like
</th>
70 var y = document.yaml_load(yaml)
72 document.write(document.js_dump(y));
78 [obj]
.0.0.foo2.key1=val1
79 [obj]
.0.0.foo2.key2=value
2
83 [obj]
.0.0.foo3.3=items
84 [obj]
.0.0.foo3.4=with the last item being a long string
85 [obj]
.0.0.foo4.0=another
88 [obj]
.0.0.foo4.3=values
89 [obj]
.0.0.foo5a=A block of text
90 that is on multiple lines.
91 [obj]
.0.0.foo5b=A block
96 [obj]
.0.0.foo6a=A block of text that is on multiple lines and is folded.
97 [obj]
.0.0.foo6b=A block of text that is on multiple lines and is folded.
99 [obj]
.0.0.foo7=singlequoted'with embedded quote
100 [obj]
.0.0.foo8=doublequoted"with embedded quote
108 document.write("Elapsed time: "+((t2.getTime() - t1.getTime())/
1000)+" seconds");