When using kxml2 to analyze "unknown" XML documents, I stumbled upon the fact that only nodes of the type ELEMENT are assigned their predecessors. So it is not possible to walk through the parse tree if the start point is not of type ELEMENT Wouldn't it be more sensible if elements of the type COMMENT and TEXT (possibly all) also get their predecessor. Should the memory requirement or the garbage collection be the reason for this decision perhaps using a weake reference for parrent could be the solution.
I hope I haven't overlook other side effects.
in Class:
org.kxml2.kdom.Node.java
at Method:
public void addChild(int index, int type, NodeInterface child) {
[...]
if (type == ELEMENT) {
if (!(child instanceof Element))
throw new RuntimeException("TestElement obj expected)");
((Element) child).setParent(this);
}
[...]
}
Hello Stefan,
When using kxml2 to analyze "unknown" XML documents, I stumbled upon the fact that only nodes of the type ELEMENT are assigned their predecessors. So it is not possible to walk through the parse tree if the start point is not of type ELEMENT Wouldn't it be more sensible if elements of the type COMMENT and TEXT (possibly all) also get their predecessor. Should the memory requirement or the garbage collection be the reason for this decision perhaps using a weake reference for parrent could be the solution.
I hope I haven't overlook other side effects.
in Class:
org.kxml2.kdom.Node.java
at Method:Thanks
Best wishes
Andreas