I ran into a problem while developing onto Blackberry. I am using KXML2 api for XML parsing (well actually, I got someone else's code to continue and fix, so I have to use this). The problem is the lack of cloning in java me, and im having some difficulities when trying to deep copy a node. (I dont want to go into details, but the point is, that i need to substitue data into specific points of a html and there is an xml describer for that) So..! :)
XMLElement childNode = node.getElement(ci);
This is the element I need to copy. XMLElement is a simple wrapper class, never mind that, it contains and Element attribute and some useful methods.
Now what I want is kind of like something like this :
XMLElement newChildNode = childNode.clone();
Since there is no cloning, no clonable interface in Java ME, I cannot do that, and this only creates a reference to the original element, which i need to preserve, while modifying the new element:
XMLElement newChildNode = childNode;
Can anyone come up with a usable idea about, how to create a deep copy of my childNode element? Thank you very much in advance!