-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import Grainfather recipe BeerXML file #853
Comments
Hi, Sorry to hear you're having problems. Thanks for attaching the file. Long story short is that BeerXML is a bit complicated, and we're gradually working on making things better. Your file will help! The problem with BeerXML is that, although it's supposed to be a standard format, there never used to be a way of checking whether a file adhered to the standard, and some programs didn't follow it very well. Brewtarget will usually import something if it's "correct" BeerXML, but sometimes has problems when things are missing or different from what they are supposed to be. We are gradually trying to address this, as we discover what different "interpretations" of the standard are, we can try to make allowances for them so that we can read more files from other programs. I will use your file to see how we can improve Brewtarget to be more accepting of anomalies in the file formats. In the future, there is a hope that things will be better if more programs start using the newer standard file format, BeerJSON. It has a standard way to check that a file is "correct", so it should be a lot more guaranteed that a file exported from one program can be read in another. We support this format in Brewtarget, but, as yet, we are one of the first programs that does, so we are waiting (and hoping) for other ones to catch up. In the meantime, you can usually get things to load in Brewtarget by making edits to the BeerXML file, but it can be a bit tedious. (If you export a recipe from Brewtarget, it will give you a correct format BeerXML file that you can use as a guide.) For the file you uploaded, the first error you see is easily fixed, just add a line break on the first line of the file, to change:
to
If you then save this and try to reimport, you'll get another error, because it's complaining that there's missing info about the Mash. You can fix this by changing the block that reads:
to read:
The next error you'd get is about a non-standard tag. Change the following line:
to:
The next one is to change the following block:
to:
You now have correct BeerXML. Unfortunately, it still doesn't load because you've uncovered a bug in Brewtarget, where we think the "Equipment" subrecord on a Recipe is mandatory, when it is in fact optional. I'll do a fix for this soon, after which you would be able to read the file. Sorry that's a bit of an unsatisfactory answer. We will try to make things better. Happy to answer more questions if I can. |
No issues, I had similar problems a couple of decades ago writing MusicXML import/export for my music software, fully get it. Its a standard until it isn't :). Thanks for the additional info, I took a dump from Brewtarget and was going compare it to craft a python script to massage the Grainfather file into happiness. Will take your comments to accelerate the process. I doubt it is of much importance for the Grainfather folks to comply. They want people to use their software so exporting issues would be a low priority I suspect. Take care |
The patch at #854 allows the "corrected" file to load, and stops us minding about multiple tags on the first line or missing |
Patch above included in Brewtarget 4.0.7. |
I use a Grainfather for brewing and frequently I'll make an all grain kit that comes with a Grainfather "recipe" or my own recipe.
Grainfather tracks stuff in the cloud so I like to track my brews in Brewtarget so if Grainfather ceases to be I have a log of my stuff.
I export the the Grainfather recepe using Export/Download XML in Grainfather. The XML file loads fine into BeerSmith 2 but fails to load in Brewtarget.
I get an error: Fatal Error at line 148, column 3: expected end of tag 'BEER_XML'.
I've attached a copy of the file, it is an xml file, but I had to change the extension to .pdf in order to be able to upload it to git hub.
It would be nice to be able to import Grainfather generated XML files.
Here is the log output for it:
[13:46:06.125] (iv8) WARNING : IGNORING the following parse error because we are assuming unrecognised tags are just non-standard tags in the BeerXML :
C:/Users/cwelch/Documents/My FileCenter Documents/Brewing/Recipes/Ale/Hazy IPA/grain_to_glass_-stratacaster_hazy_session_ipa.xml: Error at line 1, column 49: no declaration found for element 'RECIPES' [xml/BtDomErrorHandler.cpp:146]
[13:46:06.126] (iv8) WARNING : IGNORING the following parse error because we are assuming unrecognised tags are just non-standard tags in the BeerXML :
C:/Users/cwelch/Documents/My FileCenter Documents/Brewing/Recipes/Ale/Hazy IPA/grain_to_glass-stratacaster_hazy_session_ipa.xml: Error at line 2, column 13: no declaration found for element 'RECIPE' [xml/BtDomErrorHandler.cpp:146]
[13:46:06.127] (iv8) ERROR : "C:/Users/cwelch/Documents/My FileCenter Documents/Brewing/Recipes/Ale/Hazy IPA/grain_to_glass-_stratacaster_hazy_session_ipa.xml: Fatal Error at line 148, column 3: expected end of tag 'BEER_XML'" [xml/BtDomErrorHandler.cpp:156]
grain_to_glass_-_stratacaster_hazy_session_ipa -xml.pdf
The text was updated successfully, but these errors were encountered: