rootElement.add(newPlaceholder);
addSchemaLocation(placeholder, callback, schemaLocations);
}
catch (ParserConfigurationException e)
{
throw new MuleArtifactFactoryException("Error parsing XML", e);
}
}
// the parentElement is the parent of the element we are adding
Element parentElement = rootElement;
addSchemaLocation(element, callback, schemaLocations);
if (embedInFlow)
{
// Need to put the message processor in a valid flow. Our default flow is:
// "<flow name=\"CreateSingle\">"
// + "</flow>"
parentElement = rootElement.addElement("flow", "http://www.mulesoft.org/schema/mule/core");
parentElement.addAttribute("name", flowName);
}
try
{
parentElement.add(convert(element));
processGlobalReferences(element, callback, rootElement, schemaLocations);
// For message sources to work, the flow should be valid, this means needs to have a MP
if (embedInFlow)
{
parentElement.addElement("logger", "http://www.mulesoft.org/schema/mule/core");
}
setSchemaLocation(rootElement, schemaLocations);
return document.asXML();
}
catch (Throwable t)
{
throw new MuleArtifactFactoryException("Error generating minimal XML configuration.", t);
}
}