The cloneNode(Document) method broke in Xerces-J 1.4.4. It had been working in 1.4.3 through 1.4.0. The same problem occurred in 1.3.1 and earlier. This affects my XInclude processor and anybody else who needs to clone a document. org.w3c.dom.DOMException: Node type being imported is not supported at org.apache.xerces.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.ja va:1051) at org.apache.xerces.dom.CoreDocumentImpl.cloneNode(CoreDocumentImpl.jav a:348) at org.apache.xerces.dom.DocumentImpl.cloneNode(DocumentImpl.java:202) at com.macfaq.xml.DOMXIncluder.resolve(src/com/macfaq/xml/DOMXIncluder.j ava:121) at com.macfaq.xml.DOMXIncluder.main(src/com/macfaq/xml/DOMXIncluder.java :512)
I got the same DOMException when deep cloning document with xerces-j 1.4.4 in xalanj 2.2.D14. ----- org.w3c.dom.DOMException: Node type being imported is not supported at org.apache.xerces.dom.CoreDocumentImpl.importNode (CoreDocumentImpl.java:1051) at org.apache.xerces.dom.CoreDocumentImpl.cloneNode (CoreDocumentImpl.java:348) at org.apache.xerces.dom.DocumentImpl.cloneNode(DocumentImpl.java:202) at com.ericsson.pcore.pcpres.requestbroker.impl.DefaultRequestBroker.processApplica tionData(DefaultRequestBroker.java)
I have same problem for clone this Document: <?xml version="1.0" encoding="windows-1251"?> <!DOCTYPE root [ <!ENTITY copyright "Copyright"> ]> <root> <item title="©right;"/> </root> =================== DOMParser parser = new DOMParser(); parser.setFeature("http://xml.org/sax/features/validation", false); parser.setFeature("http://xml.org/sax/features/namespaces", true); parser.setFeature("http://xml.org/sax/features/external-general-entities", true); parser.setFeature("http://xml.org/sax/features/external-parameter-entities", true); parser.setFeature("http://apache.org/xml/features/validation/dynamic", true); parser.setFeature("http://apache.org/xml/features/validation/warn-on-duplicate-attdef",false); parser.setFeature("http://apache.org/xml/features/validation/warn-on-undeclared-elemdef",false);