XML Reference documentation/tutorial

What is the problem? Please be detailed.

I'd like to learn the XML that is used for forms in order to be capable of creating forms without using tools like Excel or XLSForm Online. The opendatakit/sample-forms page on Github helped me a lot, so I have my first selfmade forms tested successfully.
Now I would like to take the step from trial/error towards RTFM. The docs.opendatakit.org explain the forms quite well but only for users of tools like Excel, I did not found any examples of XML code there.
Could you recommend some links to such ducumentation/tutorials?

What ODK tool and version are you using? And on what device and operating system version?

Recent versions, ODK Aggregate on Debian Linux

Hi @Hartmut_Noack

ODK Xforms Specification

These Javarosa tutorials might be of interest to you:

Xforms training materials
Xforms repeats
Xform

Very interesting, indeed, so thanks a lot.

Anyway: do you know some tutorials that are a bit more specific regarding Xforms for ODK?

For instance:

whithin the instance block one can set a version for a form.

DonneesDemograph2 id="demograph1" version="2018121201"

The DonneesDemograph2 is the name of the file, because I learned, that the filename is used to set a unique identifier for a form. But ODK Aggregate rejects the upload complaining about bad synthax. Of course the line is in angle brackets, I do work with XML for about 20 years now.... So I think, the DonneesDemo... part is wrong.
What should I set here for a file named DonneesDemograph2.xml ?

If it's ok to share publicly, it might be easiest for you to upload the form in question. And it'd also be good to know what version of Aggregate you are running.

1 Like

We use v1.7.1
The XML is this one:
It should take many more items, including photos taken by the collector device, GPS coordinates and if possible: a ID scanned from a QR tag on the spot in the field, where the data is taken.
Since we are about to develop the form step by step the versioning would be most important.

DonneesDemograph2.xml (1.2 KB)

Unless you have a really good reason to build the form in XML, I'd recommend you use XLSForm. It will prevent you from making these sorts of mistakes.

This is what you put in the form you uploaded:

<instance>
 <!--<DonneesDemograph2 id="demograph1" version="2018121201">-->
	<!-- submitted data and defaults go here -->
	<data id="demograph1">
		<NomLieu/>
        <NomSIG/>
        <NomPop/>
	</data>
</instance> 

This is what it should be:

<instance>
	<!-- submitted data and defaults go here -->
	<data id="demograph1" version="2018121201">
		<NomLieu/>
        <NomSIG/>
        <NomPop/>
	</data>
</instance> 

Note that the node inside the instance block is where the id and version should go. If you want to call it something besides data, then that change has to be made everywhere.

For example, your bind would go from this

<bind nodeset="/data/NomLieu" type="string" />

to this

<bind nodeset="/DonneesDemograph2/NomLieu" type="string" />

Thank you very much, that was exactly the information, I was looking for.

Our project uses ODK to collect data in the field in Africa. Our resources for training the staff are limited so we consider it best practice, to provide the forms without the need to construct new forms by people in the local centers, where our appliances are deployed. In short: we try to avoid the side effects, that may arise if people work with Excel to produce tools that are critical for our data structures.
The data we collect will be read by a central application to show it in statistics and maps. Typos like "Demograph 1" instead of "demograh1" are to be avoided.
At the same time we have to deliver interfaces in several languages, that we do not master(Kabiye etc).
So we plan to offer a tool for local admins, that exposes only labels to be changed.

As far as I understand XLSForm, it allows to change everything in a form, and we do not want new columns and deleted columns or renamed ones etc.