Fixed ALF-5099: Error when trying to go back in Create Web Content Wizard (only with certain XSDs)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23049 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-10-12 14:18:38 +00:00
parent 39eff2a3ae
commit 1b56833a18

View File

@@ -450,9 +450,18 @@ public class Schema2XForms implements Serializable
for (Node old : l)
{
Element oldEl = (Element)old;
// Copy the old instance element rather than cloning it, so we don't copy over attributes
Element clone = newInstanceDocument.createElementNS(oldEl.getNamespaceURI(), oldEl.getTagName());
Element clone = null;
String nSUri = oldEl.getNamespaceURI();
if (nSUri == null)
{
clone = newInstanceDocument.createElement(oldEl.getTagName());
}
else
{
clone = newInstanceDocument.createElementNS(nSUri, oldEl.getTagName());
}
newInstanceNode.appendChild(clone);
if (oldInstanceNode instanceof Document)