* @return the node
*/
public static Node convertStringToNode(String s, BPELResource bpelResource) {
// Create DOM document
DocumentBuilderFactory factory = new DocumentBuilderFactoryImpl();
factory.setNamespaceAware(true);
factory.setValidating(false);
String namespaceURI = bpelResource.getNamespaceURI();
if (bpelResource.getOptionUseNSPrefix()) {
String prefix = "bpws";
s = "<"+prefix+":from xmlns:"+prefix+"=\""+namespaceURI+"\">" + s + "</"+prefix+":from>";
} else {
s = "<from xmlns=\""+namespaceURI+"\">" + s + "</from>";
}
try {
StringReader sr = new StringReader(s);
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource source = new InputSource(sr);
source.setEncoding("UTF8");
Document document = builder.parse(source);
return document.getDocumentElement();
}