Hi - I am writing an Android application that includes a feature to lookup product info by scanning EAN bar codes. I was trying to use the OpenFoodFacts API for this but had to learn that the XML that is returned is rejected by my parser:
This page contains the following errors:
error on line 150 at column 27: Namespace prefix en on maybe-vegetarian is not defined error on line 152 at column 20: Namespace prefix en on non-vegan is not defined error on line 154 at column 19: Namespace prefix en on palm-oil is not defined error on line 340 at column 8: StartTag: invalid element name
My application’s parser yields the exact same error messages. So, it’s really the produced XML that is buggy. Where or whom can I contact re. this issue?
To fix it you would need to add an xmlns-namespace definition for the “en” namespace (either in the XML header or on the “ingredients_analysis”-element). No idea, how easy or complex that would be in your setup.
Looking at it again: could it be, that this “ingredients_analysis”-element was meant to contain plain text only and someone “smuggled-in” some XML snippet here which happens to contain these “en:… -elements” and they are now simply emitted here verbatim and thereby corrupt the produced XML?