Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#48 JYaml 1.3 and 1.2 cannot parse a valid YAML file

open
nobody
None
5
2009-07-30
2009-07-30
Michael James
No

Using JYaml 1.3 and 1.2, I tried to parse a YAML file (see test1.yml attachment). I got an "End of document expected" parser error from JYaml.

When I modified the YAML file (see test2.yml attachment), it reads the document as a list of 2 maps with each map corresponding to the sequence under the organizations mapping.

It should have read test1.yml as a list of maps, and test2.yml as a map with 1 entry which would be a list of maps.

I parsed these same documents with Snake-YAML 1.3 and it worked as expected.

I attached the code I used to load these documents (see JYamlTest.java attachment).

Discussion

  • Michael James
    Michael James
    2009-07-30

    1st sample YAML file

     
    Attachments
  • Michael James
    Michael James
    2009-07-30

    2nd sample YAML file

     
    Attachments
  • Michael James
    Michael James
    2009-07-30

    Sample code that loads test1.yml and test2.yml

     
    Attachments
  • Michael James
    Michael James
    2009-07-30

    This is a duplicate of bug 2829765. You can delete that one, since I cannot upload multiple files unless I log in first.

     
  • Why don't you use SnakeYAML ? Do you miss any features in SnakeYAML?
    -Andrey

     
  • Michael James
    Michael James
    2009-08-05

    I did end up using SnakeYAML. I submitted the bug report so that if it got fixed, other users of JYaml could benefit. Is JYaml not being maintained anymore?

     
  • I am afraid SnakeYAML is the only maintained YAML parser for Java. I do not know the status of the parser for JRuby. But it is not an option for me anyway.