I have the following xml data:
I am trying to wrap my head around how to parse this xml to insert into db tables or into RPG data structures. I have determined that if I define the xpath expression as '$d/Things/Thing/Values/Value, then I can return a row for every instance of <Value Attribute>. However, I need the attribute value as well. Also, would I need to run a separate query for the multiple occurrences under ValueList?
Code:
<Things>
<Thing ID="1">
<Name>Thing1</Name>
<Values>
<Value Attribute="FieldName1">YADDA YADDA YADDA</Value>
<Value Attribute="FieldName2">SO ON AND SO FORTH</Value>
<ValueList Attribute="FieldName3">
<Value>CA</Value>
<Value>NY</Value>
<Value>TX</Value>
</ValueList>
<ValueList Attribute="FieldName4">
<Value>US</Value>
<Value>CA</Value>
<Value>GB</Value>
</ValueList>
</Values>
</Thing>
<Thing ID="2">
<Name>Thing2</Name>
<Values>
<Value Attribute="FieldName1">YADDA YADDA YADDA</Value>
<Value Attribute="FieldName2">SO ON AND SO FORTH</Value>
<ValueList Attribute="FieldName3">
<Value>CA</Value>
<Value>NY</Value>
<Value>TX</Value>
</ValueList>
<ValueList Attribute="FieldName4">
<Value>US</Value>
<Value>CA</Value>
<Value>GB</Value>
</ValueList>
</Values>
</Thing>
</Things>



Comment