 |
|
 |
你做的一个非常棒的软件!!!你好厉害啊!
|
|
|
|
 |
|
 |
Its the best YAML Parser out there. Please update it to work with non indented list.
Madhur
http://madhurahuja.blogspot.com
|
|
|
|
 |
|
 |
Hi Liu,
I would like to use this code for a project that is GPL. Could you please release this code under either a GPL-compatible licence to allow this to occur?
Thanks!
|
|
|
|
 |
|
|
 |
|
 |
No problem. You can use it in GPL project.
Cheers.
I am happy to work with people doing great projects.
|
|
|
|
 |
|
 |
Thankyou very much for that!
|
|
|
|
 |
|
 |
I've been using this for a while now and I've been able to build a system that loads things into data structures based on the specified type and/or a list of regular expressions, as the YAML specification recommends. I have had virtually no problems with it, so many thanks from me for building a great utility. The only "issue" I've had with it is that when parsing a quoted scalar, YAML spec states that the scalar should be given a tag of "!" (empty tag, defaults to strings), whereas plain-text scalars should be given a tag of "?" (resolve via regex). The "?" tag is easily simulated by a null Property or Tag, but there's no way to tell if a scalar was quoted or not. So if I resolve 47 as an integer via regex, then "47" (with quotes) will also resolve as an integer, even though the "!" tag should be present to indicate that it's a string due to the quotes. It's not a huge concern, and I've been able to work around it without too much effort, but if you do release future versions then maybe consider adding this functionality. And thanks again; I really cannot stress how useful this is.
Edit: Support for empty flow sequences and mappings ([] and {}) is also unavailable, and I was able to add it in just a few lines of code by attempting to match ] and } on the condition that the flow sequences fail to parse contained elements.
-- Modified Friday, March 25, 2011 9:51 AM
|
|
|
|
 |
|
 |
This parser seems good, I will try it and put my comments afterwords. But anyway keep doing good work...
|
|
|
|
 |
|
 |
First of all I want to compliment you for the good work you have put into this parser. I have been using it for a prototype system now for a while and has not had any problems. However I ran into the following today. I parse this bit of YAML:
Key: !supervision
id_numerical: 100
description: >
line1
line2
line3
When I extract the scalar value of "description", i get: "line1 line2 line3line3\r\n".
I.e. the text is folded correctly, but the last line is repeated.
Any ideas? Thank you in advance.
best regards,
Anders Jørgensen, Denmark.
|
|
|
|
 |
|
 |
An addition: If I add another mapping entry just after "description" without a blank line in between, the error is still there. However, if I leave a blank line before the next entry, as in the example below, it works fine!
Key: !supervision
id_numerical: 100
description: >
line1
line2
line3
nextkey: value
|
|
|
|
 |
|
 |
The latest update fixed this bug.
I am happy to work with people doing great projects.
|
|
|
|
 |
|
 |
Dear Liu,
Thanks a lot, you are very helpful indeed!
Best regards,
Anders
|
|
|
|
 |
|
 |
Using the example YAML_Sample.txt, Please show me how to extract the home runs, as an example, for Sammy Sosa in C#.
Thanks.
|
|
|
|
 |
|
 |
W892012G9GU: !ruby/object:Finder::Network::DeviceMeta name: firewall nbname: myType: Computer computer_type: Laptop class_name: Finder::SshTypes::Computer mac: ip: 192.168.208.177 ips: - 192.168.10.2 user: root for Macintosh service_port: 22 server_name: firewall.ebclosion.com Cannot read the nested sequence for the "ips" key.
|
|
|
|
 |
|
 |
the nested sequence need be indented
I am happy to work with people doing great projects.
|
|
|
|
 |
|
|
 |
|
 |
inventory:
- a Holy Book of Prayers (Words of Wisdom)
- an Azure Potion of Cure Light Wounds
- a Silver Wand of Wonder
will raise error in this case. Any quick solution for this error?
|
|
|
|
 |
|
 |
Is this allowed by YAML syntax?
I am happy to work with people doing great projects.
|
|
|
|
 |
|
 |
Yes, I get the example from PyYAML website. It also stated in the YAML website on Example 8.22. Block Collection Nodes[http://yaml.github.com/yaml-spec/](1.2 Spec, I think 1.1 should have same for this requirement)
|
|
|
|
 |
|
 |
Yes, this is still an issue. According to the Yaml spec 8.22, this should be accepted:
sequence: !!seq
- entry
- !!seq
- nested
mapping: !!map
foo: bar
This library will only accept the sequence indented, i.e.:
sequence: !!seq
- entry
- !!seq
- nested
mapping: !!map
foo: bar
A small flaw, but painful to work around.
By the way, this is a superb library, so thank you very much - it's extremely useful. Thanks!
|
|
|
|
 |
|
 |
The mapping in YAML is just a dictionary, I think using list is not so appropriate. If user would like to access the item with the key name, user will need to iterate through the items in the list with the matching key.
|
|
|
|
 |
|
 |
This is not appropriate to using a Dictionary type for mapping because the key is not always a string, for example it can also be a Sequence.
I am happy to work with people doing great projects.
|
|
|
|
 |
|
|
 |
|
 |
Hi,
Once the yaml file has been parsed how do I get the data items, so that I can do some further processing. In the foreach loop you have a comment there saying access the Data Items using doc.Root.
For example if my Yaml is something like below
- id: tagid
tag:
- name: tagname
value: tagvalue
Can you please give an example of how to use doc.Root if I need to get the "value" of "name" Data Item
Many Thanks
Anand
|
|
|
|
 |
|
 |
The exemple text has invalid syntax.
Usually you need to judge the data type of doc.Root and then access its sub items.
like:
if (item is Scalar)
{
Use(item as Scalar);
}
else if (item is Sequence)
{
Use(item as Sequence);
}
else if (item is Mapping)
{
Use(item as Mapping);
}
else
{
return null;
}
I am happy to work with people doing great projects.
|
|
|
|
 |