Hello,
I have a problem trying to map an XML into a data structure using XML-INTO.
There is an element in the message that can be a single value of can be an array containing multiple fields. I can create a data structure to EITHER retrieve the single value or a child-data structure to hold multiple fields. What I cannot do is a create a structure that will contain both.
So before I create 2 data structures to hold the returned data (and run XML-INTO twice) can anyone define a data structure to work in a single pass?
I am not good in working in abstract values to this is the part of the original XML that I am trying to map:
I can either define the <Value> as a sub-field of the InterpretationVariable data structure with a size attribute and the "0" will map. Or I can define <Value> as having a child data structure and that will map the array data into <InterpretationRunningAgreement>
The problem is that both fields need to be defined as Value in the data structure:
This
D InterpretationVariableDS DS Qualified
D Value 10a
or
D InterpretationVariableDS Qualified
D Value LikeDS(ValuesDS)
D ValueDS DS Qualified
D InterpretationRunningAgreement LikeDS(InterpretationRunningAgreementDS) Dim(10)
I do not want to move away from using XML-INTO as the XML contains a few thousand elements.
Amy ideas?
Thanks (and sorry for the spelling/spacing errors but I had to type all the values in as cut-and-paste was causing a 403 error)
Alex
I have a problem trying to map an XML into a data structure using XML-INTO.
There is an element in the message that can be a single value of can be an array containing multiple fields. I can create a data structure to EITHER retrieve the single value or a child-data structure to hold multiple fields. What I cannot do is a create a structure that will contain both.
So before I create 2 data structures to hold the returned data (and run XML-INTO twice) can anyone define a data structure to work in a single pass?
I am not good in working in abstract values to this is the part of the original XML that I am trying to map:
<InterpretationVariable <Description>number of VK loans</Description> <DisplayName> VK Loans</DisplayName> <FieldName>Number of VK Loans</FieldName> <GroupName>General</GroupName> <Value i:type="b:int">0</Value> </InterpretationVariable> <InterpretationVariable> <Description>Amount and length of running loans</Description> <DisplayName>Running Loans</DisplayName> <FieldName>Running Agreements</FieldName> <GroupName>Running Loans</GroupName> <Value i:type="ArrayOfInterpretationRunningAgreement> <InterpretationRunningAgreement> <Type>RK</Type> <Amount>500</Amount> <Term>25</Term> and then multiple of the above fields ending with </InterpretationRunningAgreement> </Value> </InterpretationVariable> |
I can either define the <Value> as a sub-field of the InterpretationVariable data structure with a size attribute and the "0" will map. Or I can define <Value> as having a child data structure and that will map the array data into <InterpretationRunningAgreement>
The problem is that both fields need to be defined as Value in the data structure:
This
D InterpretationVariableDS DS Qualified
D Value 10a
or
D InterpretationVariableDS Qualified
D Value LikeDS(ValuesDS)
D ValueDS DS Qualified
D InterpretationRunningAgreement LikeDS(InterpretationRunningAgreementDS) Dim(10)
I do not want to move away from using XML-INTO as the XML contains a few thousand elements.
Amy ideas?
Thanks (and sorry for the spelling/spacing errors but I had to type all the values in as cut-and-paste was causing a 403 error)
Alex
Comment