Conceptual XML loading question
Posted: Wed Jun 13, 2012 11:56 pm
First, thanks in advance to all readers and responders.
I will begin receiving XML files on a monthly basis from a 3rd party vendor that will vary in attributes and length, though all based on the same XSD. My task is to attempt and create a single process that imports these files without user intervention, even though the files will vary.
Is such a concept possible?
To illustrate, I could have one file with the following (for argument sake, this is only one record, but the file would have hundreds) :
<statement>
<billingaddress>
<line1>1234 Elm St</line1>
<city>Dallas</city>
</billingaddress>
</statement>
Then, in the next file, a billing address has more elements and there is also a mailing address:
<statement>
<billingaddress>
<line1>1234 Joe St</line1>
<city>Austin</city>
<state>TX</state>
<zip>78723</zip>
</billingaddress>
<mailingaddress>
<line1>1111 Test St</line1>
<city>Austin</city>
<state>TX</state>
<zip>78723</zip>
</mailingaddress>
</statement>
As I mentioned, the XSD has not changed and specifies all of the above attributes from both files. Thus, my question is, is it possible to create a single routine to extract both addresses from both files, even though the first file does not have a mailing address and lacks all of the elements specified on the XSD?
Let me know if further clarification is required.
I will begin receiving XML files on a monthly basis from a 3rd party vendor that will vary in attributes and length, though all based on the same XSD. My task is to attempt and create a single process that imports these files without user intervention, even though the files will vary.
Is such a concept possible?
To illustrate, I could have one file with the following (for argument sake, this is only one record, but the file would have hundreds) :
<statement>
<billingaddress>
<line1>1234 Elm St</line1>
<city>Dallas</city>
</billingaddress>
</statement>
Then, in the next file, a billing address has more elements and there is also a mailing address:
<statement>
<billingaddress>
<line1>1234 Joe St</line1>
<city>Austin</city>
<state>TX</state>
<zip>78723</zip>
</billingaddress>
<mailingaddress>
<line1>1111 Test St</line1>
<city>Austin</city>
<state>TX</state>
<zip>78723</zip>
</mailingaddress>
</statement>
As I mentioned, the XSD has not changed and specifies all of the above attributes from both files. Thus, my question is, is it possible to create a single routine to extract both addresses from both files, even though the first file does not have a mailing address and lacks all of the elements specified on the XSD?
Let me know if further clarification is required.