← Back to team overview

brewtarget-devs team mailing list archive

Re: Invalid beerXML handling

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512



On 11/01/2013 10:33 PM, mik firestone wrote:
> 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[1].
> 

Great.

> 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.
> 

I think it's enough to give the missing fields some default value, which should be set to whatever value is most common for homebrewers.

> 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 think you're right to accept it anyway, and just warn the user that wherever they got the XML from is doing a bad job at following the spec.

> [1] I've already tried XSD, but the beerXML spec can't be validated by either DTD or XSD.

This sucks hard. However, do you think it's still valuable to have the XSD that you have already started?

> -- 
> In a world of ninja v. pirate, I pilot a Gundam
> 
> 

- -- 
Philip G. Lee
rocketman768@xxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCgAGBQJSd64+AAoJEBTd1CFBTQP3OOwH/0TGbTUDR9ollg97VE2UqgLA
uj5QP8YNP0AVPd98lzPomXO/kme481F91geZbf4guTJjav2j+z9XkQVW9Kw/hAM6
Zd1DfvicLykXlwgqzQdI6szGt3zU0ypmtpqmwNhY654Ds5x10B6bscemoZNH2HBi
rh6+5EYFumgkCjqfbwpFz0unedcLvl2EhduEM7KfTus+DNLuEDHxNMOHVHH9qz/0
CKuoymd1PT2PcvoZG5Em2x6FyKRjvbznukHEEkBjewUaJJbbF6GeLAXjitGPuWqC
jRRbO+5anglqPEgmXM4mSCphGgI3G0lv0TvzEe9/G8I0tYIr00u/mVVfNIJaoE4=
=u+kD
-----END PGP SIGNATURE-----


References