<activity xmlns="http://taverna.sf.net/2008/xml/t2flow"><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap /><outputMap /><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns=""> | |
<script>import org.dom4j.Document; | |
import org.dom4j.Node; | |
import org.dom4j.io.SAXReader; | |
SAXReader reader = new SAXReader(false); | |
reader.setIncludeInternalDTDDeclarations(false); | |
reader.setIncludeExternalDTDDeclarations(false); | |
Document document = reader.read(new StringReader(xmltext)); | |
List nodelist = document.selectNodes(xpath); | |
// Process the elements in the nodelist | |
ArrayList outputList = new ArrayList(); | |
ArrayList outputXmlList = new ArrayList(); | |
String val = null; | |
String xmlVal = null; | |
for (Iterator iter = nodelist.iterator(); iter.hasNext();) { | |
Node element = (Node) iter.next(); | |
xmlVal = element.asXML(); | |
val = element.getStringValue(); | |
if (val != null && !val.equals("")) { | |
outputList.add(val); | |
outputXmlList.add(xmlVal); | |
} | |
} | |
List nodelist=outputList; | |
List nodelistAsXML=outputXmlList;</script> | |
<dependencies> | |
<string>dom4j:dom4j:1.6</string> | |
</dependencies> | |
<inputs> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>xpath</name> | |
<depth>0</depth> | |
<mimeTypes> | |
<string>'text/plain'</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>xml-text</name> | |
<depth>0</depth> | |
<mimeTypes> | |
<string>'text/xml'</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
</inputs> | |
<outputs> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
<granularDepth>1</granularDepth> | |
<name>nodelist</name> | |
<depth>1</depth> | |
<mimeTypes> | |
<string>l('text/plain')</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
<granularDepth>1</granularDepth> | |
<name>nodelistAsXML</name> | |
<depth>1</depth> | |
<mimeTypes> | |
<string>l('text/plain')</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
</outputs> | |
</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean></activity> |