Spot editing a YAML document

Trans <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Has anyone given any thought to how best to "spot edit" a YAML
document? What I mean by that is, lets say we have a document:

  ---
  project: foo
  version: 0.0.1
  status: beta
  description:
    Just a Foo program.
    Does nothing whatsoever.

Now say I want to bump the version field via a script. Normally I
would have to load the whole document, change the field, then re-emit
it back to the file. What happens during this round-trip, of course,
is we loose the layout and get something like:

  ---
  status: beta
  project: foo
  description: This is just a foo program. It does nothing whatsoever.
  version: 0.0.1

But I need to be able to change version, or whatever field, without
disrupting the entire layout of the file. The reason is the files I
use are often hand edited and I want to respect the users layout
preferences.

Does the YAML specification in some way make this feasible?

Thanks,
T.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.