private void executeForComplexType()

in taverna-wsdl-generic/src/main/java/org/apache/taverna/wsdl/xmlsplitter/XMLOutputSplitter.java [123:174]


	private void executeForComplexType(Map<String, Object> result,
			List<String> outputNameList, List<Element> children, List<Attribute> list)
			throws IOException {               

		XMLOutputter outputter = new XMLOutputter();
		for (Element child : children) {
			
			if (outputNameList.contains(child.getName())) {
				int i = outputNameList.indexOf(child.getName());
				TypeDescriptor descriptorForChild = ((ComplexTypeDescriptor) typeDescriptor)
						.elementForName(outputNames[i]);
				if (outputTypes[i].startsWith("l(")
						&& descriptorForChild instanceof ArrayTypeDescriptor
						&& !((ArrayTypeDescriptor) descriptorForChild)
								.isWrapped()) {
					boolean isXMLContent = outputTypes[i].contains("text/xml");
					result.put(child.getName(), extractDataListFromChildList(
							children, isXMLContent));
                    break;
				} else {
					if (outputTypes[i].equals("'text/xml'")
							|| outputTypes[i].equals("l('text/xml')")) {
						String xmlText = outputter.outputString(child);
						result.put(child.getName(), xmlText);
					} else if (outputTypes[i]
							.equals("'application/octet-stream'")) { // base64Binary
						
						byte[] data = DatatypeConverter.parseBase64Binary(child.getText());
						result.put(child.getName(), data);
					} else if (outputTypes[i].equals("l('text/plain')")) { // an
																			// inner
																			// element
																			// containing
																			// a
																			// list
						result.put(child.getName(),
								extractBaseTypeArrayFromChildren(child
										.getChildren()));
					} else {
						result.put(child.getName(), child.getText());
					}
				}
			}
		}
		for (Attribute attribute : list) {
			if (outputNameList.contains("1" + attribute.getName())) {
				result.put("1" + attribute.getName(), attribute.getValue());
			} else if (outputNameList.contains(attribute.getName())) {
				result.put(attribute.getName(), attribute.getValue());
			}
		}
	}