public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append( "\" type=\"" + getType() +"\">"); if (getTitle() != null) { buf.append("<title>").append(getTitle()).append("</title>"); } for (Iterator<String> it=getInstructions(); it.hasNext();) { buf.append("<instructions>").append(it.next()).append("</instructions>"); } // Append the list of fields returned from a search if (getReportedData() != null) { buf.append(getReportedData().toXML()); } // Loop through all the items returned from a search and append them to the string buffer for (Iterator<Item> i = getItems(); i.hasNext();) { Item item = i.next(); buf.append(item.toXML()); } // Loop through all the form fields and append them to the string buffer for (Iterator<FormField> i = getFields(); i.hasNext();) { FormField field = i.next(); buf.append(field.toXML()); } buf.append("</").append(getElementName()).append(">"); return buf.toString(); }
public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append( "\" type=\"" + getType() +"\">"); if (getTitle() != null) { buf.append("<title>").append(getTitle()).append("</title>"); } for (Iterator it=getInstructions(); it.hasNext();) { buf.append("<instructions>").append(it.next()).append("</instructions>"); } // Append the list of fields returned from a search if (getReportedData() != null) { buf.append(getReportedData().toXML()); } // Loop through all the items returned from a search and append them to the string buffer for (Iterator i = getItems(); i.hasNext();) { Item item = (Item) i.next(); buf.append(item.toXML()); } // Loop through all the form fields and append them to the string buffer for (Iterator i = getFields(); i.hasNext();) { FormField field = (FormField) i.next(); buf.append(field.toXML()); } buf.append("</").append(getElementName()).append(">"); return buf.toString(); }
public String toXML() { StringBuffer buf = new StringBuffer(); buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append( "\" type=\"" + getType() +"\">"); if (getTitle() != null) { buf.append("<title>").append(getTitle()).append("</title>"); } for (Iterator it=getInstructions(); it.hasNext();) { buf.append("<instructions>").append(it.next()).append("</instructions>"); } // Append the list of fields returned from a search if (getReportedData() != null) { buf.append(getReportedData().toXML()); } // Loop through all the items returned from a search and append them to the string buffer for (Iterator i = getItems(); i.hasNext();) { Item item = (Item) i.next(); buf.append(item.toXML()); } // Loop through all the form fields and append them to the string buffer for (Iterator i = getFields(); i.hasNext();) { FormField field = (FormField) i.next(); buf.append(field.toXML()); } buf.append("</").append(getElementName()).append(">"); return buf.toString(); }
public String toXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append( "\" type=\"" + getType() +"\">"); if (getTitle() != null) { buf.append("<title>").append(getTitle()).append("</title>"); } for (Iterator it=getInstructions(); it.hasNext();) { buf.append("<instructions>").append(it.next()).append("</instructions>"); } // Append the list of fields returned from a search if (getReportedData() != null) { buf.append(getReportedData().toXML()); } // Loop through all the items returned from a search and append them to the string buffer for (Iterator i = getItems(); i.hasNext();) { Item item = (Item) i.next(); buf.append(item.toXML()); } // Loop through all the form fields and append them to the string buffer for (Iterator i = getFields(); i.hasNext();) { FormField field = (FormField) i.next(); buf.append(field.toXML()); } buf.append("</").append(getElementName()).append(">"); return buf.toString(); }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { boolean done = false; StringBuilder buffer = null; DataForm dataForm = new DataForm(parser.getAttributeValue("", "type")); while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("instructions")) { dataForm.addInstruction(parser.nextText()); } else if (parser.getName().equals("title")) { dataForm.setTitle(parser.nextText()); } else if (parser.getName().equals("field")) { dataForm.addField(parseField(parser)); } else if (parser.getName().equals("item")) { dataForm.addItem(parseItem(parser)); } else if (parser.getName().equals("reported")) { dataForm.setReportedData(parseReported(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(dataForm.getElementName())) { done = true; } } } return dataForm; }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { boolean done = false; StringBuilder buffer = null; DataForm dataForm = new DataForm(parser.getAttributeValue("", "type")); while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("instructions")) { dataForm.addInstruction(parser.nextText()); } else if (parser.getName().equals("title")) { dataForm.setTitle(parser.nextText()); } else if (parser.getName().equals("field")) { dataForm.addField(parseField(parser)); } else if (parser.getName().equals("item")) { dataForm.addItem(parseItem(parser)); } else if (parser.getName().equals("reported")) { dataForm.setReportedData(parseReported(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(dataForm.getElementName())) { done = true; } } } return dataForm; }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { boolean done = false; StringBuilder buffer = null; DataForm dataForm = new DataForm(parser.getAttributeValue("", "type")); while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("instructions")) { dataForm.addInstruction(parser.nextText()); } else if (parser.getName().equals("title")) { dataForm.setTitle(parser.nextText()); } else if (parser.getName().equals("field")) { dataForm.addField(parseField(parser)); } else if (parser.getName().equals("item")) { dataForm.addItem(parseItem(parser)); } else if (parser.getName().equals("reported")) { dataForm.setReportedData(parseReported(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(dataForm.getElementName())) { done = true; } } } return dataForm; }
public PacketExtension parseExtension(XmlPullParser parser) throws Exception { boolean done = false; StringBuffer buffer = null; DataForm dataForm = new DataForm(parser.getAttributeValue("", "type")); while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("instructions")) { dataForm.addInstruction(parser.nextText()); } else if (parser.getName().equals("title")) { dataForm.setTitle(parser.nextText()); } else if (parser.getName().equals("field")) { dataForm.addField(parseField(parser)); } else if (parser.getName().equals("item")) { dataForm.addItem(parseItem(parser)); } else if (parser.getName().equals("reported")) { dataForm.setReportedData(parseReported(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(dataForm.getElementName())) { done = true; } } } return dataForm; }