I tried accomplishing some XML parsing using XMLTABLE that I could not figure out so I thought about switching to XML-INTO. However, I think I am running into the same problem. Take the following XML document:
How do I set up the proper data structures so that I can get the data for the value of a tag and and attribute of the tag when they are a child array of a parent?
I think what I am looking for is:
Values.Value.Attribute = 'FieldName1'
Values.Value = 'YADDA YADDA YADDA'
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>
Code:
<Values> <Value Attribute="FieldName1">YADDA YADDA YADDA</Value> <Value Attribute="FieldName2">SO ON AND SO FORTH</Value> </Values>
I think what I am looking for is:
Values.Value.Attribute = 'FieldName1'
Values.Value = 'YADDA YADDA YADDA'
Comment