I’ve been trying to get some data out of Kobo through the API and (besides some other problems), it seem that the API is generating invalid XML?
The URL I’m using the access the data is this: https://kc.humanitarianresponse.info/api/v1/data/67602?format=xml
I’ve completed some surveys through the web interface with the same form and when I now look at the XML from the API, I see that the XML tags contain the (repeat) group and the “field” name, seperated by a slash e.g.
<group1/dataA>Some data</group1/dataA>
However, when I try to use this XML, the XML parser seems not to like the slash in the middle of the tagname.
I’ve tried to view the XML in Chrome and imported it through the XML parser of VBA and both indicate at exactly the first slash in the middle of an opening tag of a field in my first group of data, giving the error “error on line 2 at column 32: error parsing attribute name”
Doing a simple search & replace before using the XML is also not working as the slash is used in the closing tag.
So, I understand that kobo is using this format to make sure that all tags are unique within the form and that is great, but it seems to me that a different separator character should be used which fits the same purpose but will not cause the XML to be considered invalid by e.g. Chrome (which I guess anyone will agree is not an obscure barely used app)
I’ve tried some other separators like ~, $, # which Chrome didn’t seem to like either, however, the period “.” seems to work fine and from a technical perspective, the period would work very well to to describe a group name and field within the group.
I hope you agree that this could be considered a small bug that could easily be fixed in an upcoming update?
Thanks, Gerard