From a48565e171ccb60aa6a6bac880b0096f1dd1349e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 25 Jun 2017 20:13:43 +0100 Subject: [PATCH] data_forms: Fix FORM_TYPE, and <instructions/> serialisation. --- src/data_forms.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/data_forms.rs b/src/data_forms.rs index b5cd004..7e187ec 100644 --- a/src/data_forms.rs +++ b/src/data_forms.rs @@ -229,9 +229,8 @@ impl From<DataForm> for Element { Element::builder("x") .ns(ns::DATA_FORMS) .attr("type", form.type_) - .append(form.form_type) - .append(form.title) - .append(form.instructions) + .append(if form.title.is_some() { Some(Element::builder("title").ns(ns::DATA_FORMS).append(form.title)) } else { None }) + .append(if form.instructions.is_some() { Some(Element::builder("instructions").ns(ns::DATA_FORMS).append(form.instructions)) } else { None }) .append(form.fields) .build() }