EAP 6.0 and EAP 6.1 changed the default transformer to org.apache.xalan.processor.TransformerFactoryImpl and, in doing so, highlighted an issue with the way in which SwitchYard was creating DOMSources.
Executing the quickstart results in the following exception being displayed on the console
Caused by: javax.xml.transform.TransformerException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
This exception is raised because the transformer cannot find any template which matches the DOMSource and falls back to the default transformations (do nothing for elements/attributes and copy text). It attempts to create an XML document for the following result, "<?xml version="1.0" encoding="UTF-8"?> PO-19838-XYZ BUTTER 200", which raises the exception when the transformer tries to create a text node without an enclosing element.
The transformer fails to identify the template because the DOMSource is created using the document element (orders:order) causing the transformer to search for a template matching the element name (order) rather than the document . In order to match the "/" template the DOMSource must be created using the document.
|