From: <del...@st...> - 2002-10-09 06:32:47
|
I have recently started experimenting with YAML and am considering using it as a high level grammar for a small language I am designing. My question is: Is there any way to describe a valid YAML structure so that for example only one entry of the name is allowed in the example below. I would like to see something similar to a DTD that specifies a valid structure and generates an error otherwise. resources: - resource: name: R1 name: R2 profile: xxxxxx and so on... I am using the YAML.pm module. The problem here is that since the resource is a hash, the parser will simply overwrite one value with the other. As this occurrs before I receive the parsed datastructure it is hard to discover. I would like to have more control over what can be specified. I realize I can change the datastructure but would prefer not to do this. Has any work been done on a YAML validator? Best regards dle |