Hello,
I try to optimize my coding by using variables and constants.
I successfully read the “xml-input” of my form.
“xml-input” is (in my understanding) the data which was included into the form when it was generated
e.g.
<PERSON>
<DATA>
<FIRSTNAME>Jack</FIRSTNAME>
<LASTNAME>Black</LASTNAME>
</DATA>
<DATA>
<FIRSTNAME>Mike</FIRSTNAME>
<LASTNAME>Spike</LASTNAME>
</DATA>
</PERSON>
Coding (it is not as simple as described down below in my form, but the idea is the same):
var xmlTable = “PERSON”
myXML = new XML(trimXML(xfa.datasets.data.data.resolveNode(xmlTable).saveXML()))
// here it works. I only need to change PERSON to XY to use the same coding for anything else
var namePersonTwo = myXML.DATA[1]. LASTNAME;
// Output = “Spike”. Well it works in static version
// now more dynamic
var xmlTag = “LASTNAME”;
var namePersonTwo = myXML.DATA[1]. resolveNode(xmlTag);
// ERROR – resolveNode ist not a function
So how do I use resolveNode in this case. After all it worked above?!