Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ToolContentVersionFilter.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r4cc343336fea078bfffdcaf5122caf81fe451dd7 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ToolContentVersionFilter.java (.../ToolContentVersionFilter.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ToolContentVersionFilter.java (.../ToolContentVersionFilter.java) (revision 4cc343336fea078bfffdcaf5122caf81fe451dd7) @@ -14,6 +14,7 @@ import org.lamsfoundation.lams.util.FileUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -208,9 +209,21 @@ if (oldNode.getNodeName().equals(renamed.oldFieldname)) { Element newElement = root.getOwnerDocument().createElement(renamed.newFieldname); if (oldNode.hasChildNodes()) { + + //copy attributes + if (oldNode.getAttributes() != null) { + NamedNodeMap attributes = oldNode.getAttributes(); + for (int attrIndex = 0; attrIndex < attributes.getLength(); attrIndex++) { + Node clonedAttribute = attributes.item(attrIndex).cloneNode(true); + newElement.getAttributes().setNamedItem(clonedAttribute); + } + } + + //copy child nodes NodeList children = oldNode.getChildNodes(); for (int childIndex = 0; childIndex < children.getLength(); childIndex++) { - newElement.appendChild(children.item(childIndex).cloneNode(true)); + Node clonedChildNode = children.item(childIndex).cloneNode(true); + newElement.appendChild(clonedChildNode); } } else { newElement.setTextContent(oldNode.getTextContent());