* We're outputting utf8 in xml.
* We need to quote the characters <, >, &.
*
+ * Technically I don't think we'd necessarily need to quote the control
+ * characters, but at least libxml2 doesn't like them. It doesn't even
+ * allow them quoted. So we just skip them and replace them with '?'.
+ *
* Nothing else (and if we ever do this using attributes, we'd need to
* quote the quotes we use too).
*/
case 0:
escape = NULL;
break;
+ case 1 ... 8:
+ case 11: case 12:
+ case 14 ... 31:
+ escape = "?";
+ break;
case '<':
escape = "<";
break;
show_depth(f, dive->maxdepth, " <maxdepth>", "</maxdepth>\n");
show_depth(f, dive->meandepth, " <meandepth>", "</meandepth>\n");
show_temperature(f, dive->airtemp, " <airtemp>", "</airtemp>\n");
- show_temperature(f, dive->watertemp, " <watertemp>", "</airtemp>\n");
+ show_temperature(f, dive->watertemp, " <watertemp>", "</watertemp>\n");
show_duration(f, dive->duration, " <duration>", "</duration>\n");
show_duration(f, dive->surfacetime, " <surfacetime>", "</surfacetime>\n");
show_pressure(f, dive->beginning_pressure, " <cylinderstartpressure>", "</cylinderstartpressure>\n");