One issue is that:
nList.item(i)
gets a value where as it looks like you are trying to set a value to it. You can not assign anything to nList.item(i)
. The NodeList
interface itself does not have operations for appending new items into the list. You might want to look at the underlying type of NodeList
and see if you can add items to that. Also, you are not constructing the nList
variable. NodeList
is an interface. What were you going to create that as?
If you don't want that as a NodeList
, you could very easily do it as a regular List<Node>
instead. Something like this:
List<Node> nodes = new ArrayList<Node>();
int aSize = a.getLength();
int bSize = b.getLength();
int cSize = c.getLength();
if(aSize>0)
{
for (int i = 0; i < aSize; i++)
nodes.add(a.item(i));
}
...