element - any-element
parentSource - parent of any-element
parentResult - result parent of any-element peer
String elementTagName = element.getTagName();
if(elementTagName.equals("message-security-config"))
return;
NodeList resultElements = parentResult.getElementsByTagName(elementTagName);
Element resultElement = null;
String key = this.getKeyToCompare(elementTagName);
if(key != null){
for(int lh =0; lh < resultElements.getLength(); lh++){
// Compare one key attribute
if((element.getAttribute(key)).equals(((Element)resultElements.item(lh)).getAttribute(key))){
resultElement = (Element)resultElements.item(lh);
break;
}
}
}else{
// If the key is not defined then there is only one element.
if(resultElements.getLength() != 0){
resultElement = (Element)resultElements.item(0);
}
}
//Commented for CR 6480041 - Support not needed anymore since domains are created afresh
/*if(resultElement != null) {
if(resultElement.getTagName().equals("availability-service")) {
NodeList jmsAvailabilityElements = resultElement.getElementsByTagName("jms-availability");
Element jmsAvailabilityElement = (Element)jmsAvailabilityElements.item(0);
if(jmsAvailabilityElement == null) {
//Not there. Create one
jmsAvailabilityElement =
resultElement.getOwnerDocument().createElement("jms-availability");
jmsAvailabilityElement.setAttribute("availability-enabled", "false");
resultElement.appendChild(jmsAvailabilityElement);
}
}
}*/
//End - comment
if(resultElement == null){
resultElement = parentResult.getOwnerDocument().createElement(elementTagName);
this.transferAttributes(element, resultElement, this.getNonTransferList(element));
this.appendElementToParent(parentResult,resultElement);
}else {
this.transferAttributes(element, resultElement, this.getNonTransferList(element));
}
super.transform(element, parentSource, resultElement);