Hi all,
I have recently started working with JDOM. I have been trying to read through the
java api, but unfortunately still don't quite understand how to use some of the methods. My goal is to read an xml file and iterate through the child elements of the node, and append new nodes to wrap all the children of the root node. So, that being said, I am having a problem iterating through them as I do not know how I can get length of the elements as you would with a normal array. So seeing how I don't know how many children the xml file will have I can't just put in the value within the for loop. Does anyone have any insight as to how I can create a list of all the children elements much like you do with a normal array containing objects? Any help with that would be greatly appreciated. Here is what I have been trying so far looking at the API...
java.util.List<Element> getChildren()
This returns a List of all the child elements nested directly (one level deep) within this element, as Element objects.
and also tried using this...
NodeList list = svg.getChildNodes();
I haven't really gotten what I want from this, but maybe I just haven't used all the proper import statements to collaborate with the the NodeList to get what I want from it.
Thanks in advance for any help you could offer