blob: 5dbfb5521d54ad270c8776ffb7e5457442bbbf94 [file] [log] [blame]
{
"http://purl.org/dc/terms/rights": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
"http://purl.org/dc/terms/license": {"@id": "http://www.apache.org/licenses/LICENSE-2.0"},
"classLoaderSharing" : "workflow",
"script" : "//From a proposal by Mikolaj Rybinski\nimport javax.xml.transform.Source;\nimport javax.xml.transform.Transformer;\nimport javax.xml.transform.TransformerFactory;\nimport javax.xml.transform.stream.StreamResult;\nimport javax.xml.transform.stream.StreamSource;\n\nparam(paramstr) {\n nameAndValue = paramstr.split(\"=\");\n if (nameAndValue.length != 2) {\n throw new RuntimeException(\"Wrong parameter format: \\\"\" + paramstr + \"\\\".\");\n }\n name = nameAndValue[0].trim();\n value = nameAndValue[1].trim();\n return this;\n}\n\nif ((sourceString == void) || (sourceString == null)) {\n throw new RuntimeException(\"sourceString must be specified\");\n}\n\nif ((xsltString == void) || (xsltString == null)) {\n throw new RuntimeException(\"xsltString must be specified\");\n}\n\nSource inSource = new StreamSource(new StringReader(sourceString));\nSource xslSource = new StreamSource(new StringReader(xsltString));\n\n// the factory pattern supports different XSLT processors\n// e.g. set the \"javax.xml.transform.TransformerFactory\" system property\nTransformerFactory tnfFact = TransformerFactory.newInstance();\nTransformer tnf = tnfFact.newTransformer(xslSource);\n\nif (paramList != void) {\n for (String paramstr : paramList) {\n p = param(paramstr);\n tnf.setParameter(p.name, p.value);\n }\n}\n\nWriter outputWriter = new StringWriter();\ntnf.transform(inSource, new StreamResult(outputWriter));\noutputString = outputWriter.toString();",
"localworkerName" : "net.sourceforge.taverna.scuflworkers.xml.XSLTWorkerWithParameters",
"inputPorts" : [ {
"name" : "sourceString",
"depth" : 0,
"type" : "String"
}, {
"name" : "xsltString",
"depth" : 0,
"type" : "String"
}, {
"name" : "paramList",
"depth" : 1,
"type" : "String"
} ],
"outputPorts" : [ {
"name" : "outputString",
"depth" : 0,
"granularDepth" : 0
} ],
"isAltered" : false
}