I currently have this line of code :
org.jdom2.Element typeContent = root.getChildren().get(objTypeIndex);
This was working fine until you added children with other names. Then it started to bug and change the data in the wrong child. If I got index 1 it would get the first earlier. but with new children it will get the instead with current line of code. That not what I want to do.
Is there anyway I can get all children by name ?
If I have root children like
<insert-data></insert-data>
<insert-data></insert-data>
<insert-data></insert-data>
and then
<type></type>
<type></type>
<type></type>
<type></type>
And I only wanna get the from the root? How can I do that with JDOM.
Ive tried :
org.jdom2.Element typeContent = (Element) root.getChildren("type").get(
objTypeIndex);
but it cast exception : Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 19 Size: 19