I just hit a really telling example of how XML and XForms can deliver incredible productivity. The requirement: creating a dropdown menu displaying the list of all the world's countries in French, using ISO names and codes. Here is how you do it with XForms:
-
Download the XML file containing the list of countries from ISO (after finding it with Google). The file contains entries of the type:
<ISO_3166-1_Entry> <ISO_3166-1_Country_name>SUISSE</ISO_3166-1_Country_name> <ISO_3166-1_Alpha-2_code>CH</ISO_3166-1_Alpha-2_code> </ISO_3166-1_Entry>
-
Import the file in your XForms page with:
<xforms:instance id="countries-instance" src="iso_3166-1_list_fr.xml"/>
-
Refer to the list of country from the select1 control:
<xforms:select1 ref="country" appearance="minimal"> <xforms:label>Country</xforms:label> <xforms:itemset nodeset="instance('countries-instance')/*"> <xforms:label ref="ISO_3166-1_Country_name"/> <xforms:value ref="ISO_3166-1_Alpha-2_code"/> </xforms:itemset> </xforms:select1>
And that's it! Can you actually imagine anything simpler, in any language?