pkunst
11 years agoContributor
Problem with reading value of xml node
Hi there,
I have another xml problem. I am trying to read the value of a child node, but I am failing.
At first I try to get the parent node by index.
Then I want the children. At this point my script fails.
This message occurs:
Also I tried this:
But then this message occurs:
So this is what I want to do:
1. Get the parent node by name and index (there are multiple of it)
2. Get a child node by name i.e. “ChildNode5”
3. Read the value of the child node
I have another xml problem. I am trying to read the value of a child node, but I am failing.
At first I try to get the parent node by index.
Then I want the children. At this point my script fails.
def parentNode = holder.getDomNodes("//*:BatchLogDTO")[1]
def childNode = node.children()[2]
This message occurs:
groovy.lang.MissingMethodException: No signature of method: org.apache.xmlbeans.impl.store.Xobj$ElementXobj.children() is applicable for argument types: () values: [] error at line: 10
Also I tried this:
def node = holder.getDomNodes("//flex.messaging.io.amf.ASObject[1]/BatchLogDTO/*")
def cNode = node.children()[2]
But then this message occurs:
groovy.lang.MissingMethodException: No signature of method: [Lorg.w3c.dom.Node;.children() is applicable for argument types: () values: [] error at line: 14
So this is what I want to do:
1. Get the parent node by name and index (there are multiple of it)
2. Get a child node by name i.e. “ChildNode5”
3. Read the value of the child node