org.w3c.dom.DOMException Saxon Property set
Added by Anonymous about 19 years ago
Legacy ID: #3381556 Legacy Poster: Anurag Chakravarti (anurag2002)
Hi, Saxon/Xerces DOM import error. Please comment where I am going wrong. // String A String body = "<?xml version="1.0" encoding="UTF-8"?><resource-lists> <list name="friends"> <entry uri="sip:bob@example.com"> <display-name>Bob Jones</display-name> </entry> </list> </resource-lists>"; // String B String put = "<entry uri="sip:anurag@example.com"> <display-name>Bob Jones</display-name> </entry>"; System.setProperty(DOMImplementationRegistry.PROPERTY, "net.sf.saxon.om.DocumentBuilderFactoryImpl"); DocumentBuilderFactory dfactory = net.sf.saxon.dom.DocumentBuilderFactoryImpl.newInstance(); dfactory.setNamespaceAware(true); DocumentBuilder builder = dfactory.newDocumentBuilder(); String complete = builder.parse(new InputSource( new StringReader(body))); String inPut = builder.parse(new InputSource(new StringReader(put))); // my function to evaluate a XPATH query "/resource-lists/list/entry[@uri]" // returns a node NodeList nodeList = evaluateXPATH(expr, query, complete, appUsage); // error Node importedNode = complete.importNode(inPut, false); Exception in thread "main" org.w3c.dom.DOMException: NOT_SUPPORTED_ERR: The implementation does not support the requested type of object or operation. at org.apache.xerces.dom.CoreDocumentImpl.adoptNode(Unknown Source) at edu.columbia.xcap.parser.SaxonParser.putEntry(SaxonParser.java:231) at edu.columbia.xcap.test.TestPut.main(TestPut.java:50) What is going wrong above? I have set the systems property as required. Any help would be greatly appreciated. Regards -Anurag
Replies (1)
RE: org.w3c.dom.DOMException Saxon Property s - Added by Anonymous about 19 years ago
Legacy ID: #3381577 Legacy Poster: Michael Kay (mhkay)
Your application is calling Xerces and Xerces is throwing an exception. You haven't shown me the code that's failing, and it doesn't seem to involve Saxon. So it's hard for me to help. I would haazard a guess that you've created a Saxon DOM node are are trying to add it to a Xerces document, and Xerces is complaining: most DOM products don't allow you to mix nodes created by different DOM implementations in a single tree. Michael Kay
Please register to reply