Map nsMap = getAllNamespacesForElement(element);
//ExtensibilityElement extensibilityElement=deserializer.unmarshall(ExtensibleElement.class,qname,childElement,process,nsMap,extensionRegistry,resource.getURI());
ExtensibilityElement extensibilityElement=deserializer.unmarshall(extensibleElement.getClass(),qname,childElement,process,nsMap,extensionRegistry,resource.getURI());
extensibleElement.addExtensibilityElement(extensibilityElement);
} catch (WSDLException e) {
throw new WrappedException(e);
}
}
} else if (node.getNodeType()==Node.ATTRIBUTE_NODE) {
// If the attribute is not actually in the file, ignore it.
// (default attributes added by the schema parser, cause some problems for us)
if ((node instanceof Attr) && ((Attr)node).getSpecified()) {
// Handle extensibility attribute
QName qname=new QName(node.getNamespaceURI(),"extensibilityAttributes");
BPELExtensionDeserializer deserializer=null;
try {
deserializer=(BPELExtensionDeserializer)extensionRegistry.queryDeserializer(ExtensibleElement.class,qname);
} catch (WSDLException e) {}
if (deserializer!=null) {
// Create a temp element to host the extensibility attribute
//
// This turns something that looks like this:
// <bpws:X someNS:Y="Z"/>
// into something that looks like this:
// <someNS:extensibilityAttributes xmlns:someNS="http://the.namespace" Y="Z"/>
Element tempElement=element.getOwnerDocument().createElementNS(node.getNamespaceURI(), node.getPrefix() + ":extensibilityAttributes");
tempElement.setAttribute(BPELUtils.ATTR_XMLNS + ":" + node.getPrefix(), node.getNamespaceURI());
tempElement.setAttribute(node.getLocalName(), node.getNodeValue());
// Deserialize the temp DOM element and add the new Extensibility element to the parent
// ExtensibleElement
try {
Map nsMap = getAllNamespacesForElement(element);
ExtensibilityElement extensibilityElement=deserializer.unmarshall(ExtensibleElement.class,qname,tempElement,process,nsMap,extensionRegistry,resource.getURI());
if (extensibilityElement!=null)
extensibleElement.addExtensibilityElement(extensibilityElement);
} catch (WSDLException e) {
throw new WrappedException(e);
}
}
}
}
}