Error when I try to load form in KoBo Collect: "duplicate definition for text ID"

154 views
Skip to first unread message

Joshua Rodd

unread,
Oct 29, 2013, 2:11:57 PM10/29/13
to kobo-...@googlegroups.com
Hello,

Wondering if anyone can help me out with this. I just tried to load a newly created form on to a Google Nexus 7, but got the following error message:

Duplicate definition for text ID "A573_1 and form "null". Can only have one definition for each text form. 

Problem found at nodest: /html/head/model/itext/translation[@lang=English]/text
With element <text id="A573_1">

My knowledge of XML is basically zero.Can anyone advise me on what the problem is? I assume it's because I've got a duplicate lines of code that are hanging up the tablet, but I'm nto sure how to fix that. I've attached my code to this post in the hopes someone might be able to suggest something. 

The survey is more-or-less done; I'm waiting for information to populate a couple of single-select options and I'm in the process of entering the translations for the three non-English versions. I mention that because I'm wondering if adding three languages may have jammed things up. Has anyone had problems with that before?

Thanks!
Josh
UGANDAN NATIONALS English_1029.rtf

Vinck, Patrick

unread,
Oct 29, 2013, 5:05:53 PM10/29/13
to kobo-...@googlegroups.com

Hi Josh,

 

Question A573 and A574 have the same options and the id for the response options was defined in both cases as A573_1,A573_2 …

So in the xml file, I searched for A573_1 and edited the id as A574_1 when following A574. Since there are multiple languages defined I had to do this multiple times.

Giving you the details so that you can check it for yourself if needed (it is a good idea to just check the xml – you will see it is not hard to ‘read’). I am not able to test the form right now, but let me know if it works.

 

We are working hard to fix the bugs that cause this types of problems - mainly related to drag and drop and errors occurring when changing question types from single select to multi-select. That being said I had not seen this specific  error before. I supposed you used copy and paste? Anything else occurred while writing the questionnaire? We are also working on a brand new version of KoBo in the next 6 months.

 

Also it is a good idea to insert the translations once everything is completed and also to save your form as often as possible!

 

Hope KoBo is still useful!

 

(PS you can always open an xml file in any text editor – I use notepad++ for editing manually)

--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.
To post to this group, send email to kobo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/kobo-users.
For more options, visit https://groups.google.com/groups/opt_out.

Josh.xml

Joshua Rodd

unread,
Oct 30, 2013, 11:10:36 AM10/30/13
to kobo-...@googlegroups.com
Hi Patrick,

That seemed to solve that problem; thank you! 

Yes, the problem seemed related to the Copy and Paste function. I used Copy and Past quite a bit, so I have tried to skim through  the XML code and see if there are any other issues, but I haven't found any. I'm sure they'll turn up eventually, though. 

I'm afraid I found another issue as soon as I put the code you had revised on the tablet, and my efforts to fix it seem to have messed things up worse. When I tested the revised code, I got the following error from the tablet: 

Question <label> 'A103': Text is not localizable for default locale [English]!

Sure enough, when I looked a the XML I found the following: 
          

          </text>

          <text id="A103_MULTI__1">

            <value>Family Member</value>

          </text>

          <text id="A103_1">

            <value>Neighbor (Ugandan)</value>

          </text>

          <text id="A103_2">

            <value>Visitor to the Area (Ugandan)</value>

          </text>

          <text id="A103_3">

            <value>Ugandan, dwelling unknown</value>

          </text>

          <text id="A103_4">

            <value>Neighbor (Refugee)</value>

          </text>

          <text id="A103_5">

            <value>Visitor to the Area (Refugee)</value>

          </text>

          <text id="A103_6">

            <value>Refugee, dwelling unknown</value>

          </text>

          <text id="A103_7">

            <value>Other Foreigner (Not a Refugee)</value>

          </text>

          <text id="A103_8">

            <value>Other</value>

          </text>

          <text id="A103_9">

            <value>Don't Know/Can't Recall</value>

          </text>

          <text id="A103_10">

            <value>Decline to Respond</value>

          </text>

          

Which I think was related to my accidentally toggling the "Multiselect" function and then turning it off again; apparently the code saved funny. Based on the surrounding XML code, I revised the section to read as follows: 

          </text>

          </text id=”A103”>

<value>"I would like to ask you about the person who you judge was primarily the person who opposed you in this conflict. You will not be asked to identify the person by name. Please listen to this list of possible responses and select the one that best describes the person with whom this conflict was primarily conducted." {Read responses}</value>

</text>

          <text id="A103_1">

            <value>Family Member</value>

          </text>

          <text id="A103_2">

            <value>Neighbor (Ugandan)</value>

          </text>

          <text id="A103_3">

            <value>Visitor to the Area (Ugandan)</value>

          </text>

          <text id="A103_4">

            <value>Ugandan, dwelling unknown</value>

          </text>

          <text id="A103_5">

            <value>Neighbor (Refugee)</value>

          </text>

          <text id="A103_6">

            <value>Visitor to the Area (Refugee)</value>

          </text>

          <text id="A103_7">

            <value>Refugee, dwelling unknown</value>

          </text>

          <text id="A103_8">

            <value>Other Foreigner (Not a Refugee)</value>

          </text>

          <text id="A103_9">

            <value>Other</value>

          </text>

          <text id="A103_10">

            <value>Don't Know/Can't Recall</value>

          </text>

          <text id="A103_11">

            <value>Decline to Respond</value>

          </text>


Which I thought would work. However, when I tried to load my revised code in KoBo Form by pasting the text, it only loaded the headings, and no questions (please see attached screen shot). 


Very odd. I assumed that while changing the code I must have deleted something on accident. However in comparing my revised code with the original I can't see anything different except for my changes. So I assume there's something wrong with the changes? Any thoughts?

I've attached the screen shot, and the revised code. Thanks for any help you can offer!

Thanks,
Josh

--
You received this message because you are subscribed to a topic in the Google Groups "Kobo Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kobo-users/M5-6FnUSK5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kobo-users+...@googlegroups.com.
Josh_Revised_A103_131030_2.xml
KoBo_ScrSht_Probs.JPG

Tino Kreutzer

unread,
Oct 30, 2013, 11:55:58 AM10/30/13
to kobo-...@googlegroups.com
Hi Josh,

It seems that when you edited the XML you somehow deleted the body part that actually creates the questions and answer options. If this happened while importing into KoBoForm, please check the form version that you were trying to import prior to that. The version that Patrick sent yesterday was 1290KB, but the one you just sent is only 85KB.

I'll check what the problem was with yesterday's form.

Tino


Tino Kreutzer

unread,
Oct 30, 2013, 12:20:18 PM10/30/13
to kobo-...@googlegroups.com
Hi Josh,
Here's the fixed form based on what Patrick sent yesterday. There were some problems with A103 that were easy to fix. Specifically, the question didn't have a label, so I repeated the label from question 102 again (which is the lead in question anyway), and the 'Family' option was using the same value as Neighbor. 

This now loads fine on Android as well as on KoBoForm.

Let us know if you have other issues.

Cheers,
Tino
Josh_01.xml

Joshua Rodd

unread,
Oct 30, 2013, 3:01:48 PM10/30/13
to kobo-...@googlegroups.com
Thanks, Tino! I just worked it out myself. I'm not sure how I deleted so much when I tried to edit it myself...I compared the two after editing before I saved my version to .XML, and I would have sworn they were the same except for the edits. Anyway, thank you so much for your help!

Josh
Reply all
Reply to author
Forward
0 new messages