Dear readers & problemsolvers,
while programming i had the next error:
<ERROR>
Cannot convert: org.dom4j.tree.DefaultElement@9fd93 [Element: <book att
ributes: []/>] into a W3C DOM Node
Exception in thread "main" org.w3c.dom.DOMException: Not supported yet
at org.dom4j.dom.DOMNodeHelper.notSupported(DOMNodeHelper.java:429)
at org.dom4j.dom.DOMNodeHelper.asDOMNode(DOMNodeHelper.java:366)
at dom4jTest.main(dom4jTest.java:84)
</ERROR>
The problem is that i can't cast a dom4j.Node to a w3cNode!
<CODE>
import org.dom4j.*;
....
// parse a document into a DOMDocument.
org.w3c.dom.Document domDocument = builder.parse(new
File("record.xml"));
DOMReader reader = new DOMReader();
// Convert the DOMDocument to a DOM4J-Document
Document dom4JDocument = reader.read(domDocument);
// Casting the Object
Node dom4jBookNode =
xpathSelector.selectSingleNode(dom4jDocument);
org.w3c.dom.Node BookNode =
DOMNodeHelper.asDOMNode(dom4jBookNode);
domDocument = (org.w3c.dom.Document) dom4jDocument;
...
</CODE>
None of the conversions are working.
When i use DOMWriter i can get a valid W3C Document.
The problem is I should be able to convert the Nodes!
Any help is welcome...
Regards
--
Huenaerts Bram
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
PC Mods, Computing goodies, cases & more
http://thinkgeek.com/sf
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Gadgets, caffeine, t-shirts, fun stuff.
http://thinkgeek.com/sf
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev