if I use the xml-into command with allowmissing=yes, how can I tell if I recieved a tag name? allowmissing=yes will prevent it from giving an error but I want to know which tags I recieved. allowmissing=no will tell me I didn't get all my fields but I want to know which one I did receive. Is there a way to do that with xml-into?
Software/Hardware used:
ASKED:
October 19, 2012 3:07 PM
Is there a way to do that with xml-into?
The documentation for allowmissing=yes tells you how to tell if an element was missing, and even shows an example of coding to detect a missing element.
The way to tell if an element was not missing is simply the opposite of an element that was missing.
Tom
I need to know that I got the element so I know what to do to the field in my database file. I was hoping for an option in xml-into that would tell me that I got a value in the field, or didn’t get a value in the field.
My data structure has 3 elements: Text 1A, Test 1S0 and Temp 3A.
My file contains Txt = ‘X’, Tst = 9 and Tmp = ’123′.
My doc just has <Temp>AAA</Temp>.
After the XML-into, Text will be a space, Test will be a zero and Temp will be ‘AAA’.
I don’t want to change Txt from ‘X’ to a space nor Tst from 9 to zero, I only want to change Tmp from ’123′ to ‘AAA’.
After the XML-into, Text will be a space, Test will be a zero and Temp will be ‘AAA’.
That’s what you have after XML-INTO. But what was the value of [Temp] before XML-INTO?
Because the data structure is part of your program, you are responsible for setting an intial value of [Temp] before you run XML-INTO. If you set it to *LOVAL for example, you can test to see if it still has *LOVAL after you run XML-INTO. If the value has changed, you know that you received a new value.
I’m not sure how to clarify that.
Tom