Subject:Flatten an XML source Author:Lawrence Harris Date:12 Nov 2008 10:39 AM
I have an XML source similar to:
<ProductInfo>
<ProductName>xxx</ProductName>
<Versions>
<VersionRec>
<VersionInfo>yyy</VersionInfo>
<VersionMajorNo>1</VersionMajorNo>
<VersionMinorNo>3</VersionMinorNo>
<Revisions>
<RevisionRec>
<RevisionNo>1.2</RevisionNo>
<RevisionInfo>blahblahblah<RevisionInfo>
</RevisionRec>
<RevisionRec>
<RevisionNo>1.1</RevisionNo>
<RevisionInfo>blahblahblah<RevisionInfo>
</RevisionRec>
</VersionRec>
<VersionRec>
<VersionInfo>yyy</VersionInfo>
<VersionMajorNo>1</VersionMajorNo>
<VersionMinorNo>4</VersionMinorNo>
<Revisions>
<RevisionRec>
<RevisionNo>1.3</RevisionNo>
<RevisionInfo>blahblahblah<RevisionInfo>
</RevisionRec>
</VersionRec>
</Versions>
</ProductInfo>
I am trying to flatten the XML so that I can write the information to a database as a single complete record per revision (each record has all the information instead of me creating multiple tables).
I am having problems doing this and typically losing the revision details.
Can anybody point me in the right direction?
Thanks