brewtarget-devs team mailing list archive
Mailing list archive
Invalid beerXML handling
We have a problem with some invalid beerXML causing brewtarget to dump
core. I'm working on the fix for that in three stages: fix the core dump,
warn the user and figure out some kind of validation scheme.
I'm seeing things like Yeast records not including the form (e.g., liquid
or dry) and the laboratory (e.g. white labs). My current approach is to
ignore the missing fields, import the record and warn the user that they
need to double check these things.
The problem is that this will make a mess out of our database. It also
means we will be propagating bad information.
Should I make some effort to correct the bad record? For example, search to
see if we have a yeast named 'WLP001' and do the right thing? Still warn
the user, but possibly reduce the work the user has to do.
Should I refuse to import an invalid recipe? That's going to be a lot
harder, and I think I would prefer to be generous in what I accept and
conservative with what I generate -- to paraphrase the EEs.
 I've already tried XSD, but the beerXML spec can't be validated by
either DTD or XSD.
In a world of ninja v. pirate, I pilot a Gundam