• Welcome to the new forum! We upgraded our forum software with a host of new boards, capabilities and features. It is also more secure.
    Jump in and join the conversation! You can learn more about the upgrade and new features here.

Invalid XML syntax in BeerXML export

mike

New Forum Member
Joined
Sep 10, 2011
Messages
2
Reaction score
0
Just downloaded the 2.0.42 beta to test out the BeerXML exporting (to Brewing Alarm).
When I try to open the recipe in Brewing Alarm, it crashes.
Looking at the XML file in Firefox, I get the following error:
XML Parsing Error: undefined entity

It appears that the following (at least, as they are the ones in my recipe) are causing the problem:
”
“
’
ô
é

When I replace/remove those "characters" the XML validates correctly and I am able to import the XML file into Brewing Alarm.

Really enjoy using BeerSmith...

Thanks,
Mike

 
Hi,
  Actually I extended the XML in BeerSmith 2 to include full XHTML spec entities for extended unicode character sets:
    http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

  The first 245 or so are in the XHTML standard.

  BeerSmith 1 did not support unicode which was a real limitation for many of those in Europe and other countries.

Brad
 
Brad,

Not sure why neither Firefox nor Brewing Alarm (nor the W3C XML validator, for that matter) like those character references.

I replaced all the "Name" characters with their "Unicode" values (” -> ” for example) and that seemed to fix the problem.

Mike
 
Brad,
This bug still exists. It is breaking BeerXML import into the Brew Competition Online Entry (BCOE) software which is used by many homebrew comps. Viewed in Chrome, the browser says that the XML files contain errors due to the ldquo; usage.

According to wikipedia those characters are only supported in XHTML.
http://en.wikipedia.org/wiki/Quotation_mark_glyphs

Your files are missing a DOCTYPE, therefore they are not XHTML files - they are XML files.
http://en.wikipedia.org/wiki/XHTML

I inserted a DOCTYPE and this fixed the problem. Any doctype should do; I used the xhtml1 transitional.
http://en.wikipedia.org/wiki/Document_Type_Declaration

Unfortunately, though that may make the document XHTML valid, it still does not work in BCOE import. I suspect BCOE's xml parser does not support XHTML and is ignoring the doctype. So all of the ldquo and rdquo, and rsquo's need to be removed manually which is quite tedious.

You should consider just using the characters' unicode encoding instead, as discussed here:
http://www.stylusstudio.com/xsllist/200310/post40740.html

Or just use regular quotes instead of directional quotes.
 
Hi,
  I'm thinking of making this an option - can you provide a link to BCOE so I can do some testing with it?

Brad
 
BCOE is here: http://www.brewcompetition.com/index.php?page=testDrive
Looks like he has a test instance up there, and there's also contact info. In the iframed test instance you need to register and then click the import link.
Seems a little weird to make it an option - why would anyone have a problem with unicode or straight quotes? Unless another program is dependent on them...
 
Back
Top