powered by Jive Software

Defect in FormField.Option class

Smack 4.0.1

toXML method of org.jivesoftware.smackx.xdata.FormField.Option class produces invalid XML string because of the close element is ‘field’ instead of ‘option’ (see code below):

public class FormField {

public static final String ELEMENT = “field”;

public static class Option {

public static final String ELEMNT = “option”;

public XmlStringBuilder toXML() {

XmlStringBuilder xml = new XmlStringBuilder();


// Add attribute

xml.optAttribute(“label”, getLabel());


// Add element

xml.element(“value”, getValue());


return xml;




Thanks for reporting SMACK-589