Hi All,
I've been given an XML file (12 MB) that I need to extract data from. The
XML file makes the data easy to view, but the data is impossible to analyze
in its current format. I've looked at lots of XMLTextReader stuff and I
can't seem to figure out how to extract the info that I want. Here's a quick
example of the XML format:
<instance identity="A1" name="A1" type="A_Type">
<attribute Name="AttA1-1">
<value>
X
</value>
</attribute>
<instance identity="B1" name="B1" type="B_Type">
<attribute Name="AttB1-1">
<value>
X
</value>
</attribute>
<instance identity="B2" name="B2" type="B_Type">
<attribute Name="AttB2-1">
<value>
X
</value>
</attribute>
<instance identity="C1" name="C1" type="C_Type">
<attribute Name="AttC1-1">
<value>
X
</value>
</attribute>
</instance>
</instance>
</instance>
</instance>
Each A_Type contains several B_Types, and each B_Type contains several
C_Types and the file contains lots of A_Types. I've shown one attribute
each, but there are lots of them for each type!
what I'd like to do is load this data into a few tables with Master-Detail
Releations. So Table A would contain a row for each A_Type plus it's
attributes (with the Attribute Name as the Column Header). For a given row
selected in Table A, Table B would show each of the B_Types and it's
attributes, etc.
So, is there an easy way to get the data from the file using an
XMLTextReader or some other nifty XML tool, or is this going to be a brute
force method with regular expressions and do loops?
I'm not sure if I've supplied enough info, so if you need to know something
else before you can give me an answer, please let me know!! If it's going to
be brute force, that's fine, but I'd hate to spend a few days coding, only
later to find out that there was a quick way to do this!
TIA
Lee
I've been given an XML file (12 MB) that I need to extract data from. The
XML file makes the data easy to view, but the data is impossible to analyze
in its current format. I've looked at lots of XMLTextReader stuff and I
can't seem to figure out how to extract the info that I want. Here's a quick
example of the XML format:
<instance identity="A1" name="A1" type="A_Type">
<attribute Name="AttA1-1">
<value>
X
</value>
</attribute>
<instance identity="B1" name="B1" type="B_Type">
<attribute Name="AttB1-1">
<value>
X
</value>
</attribute>
<instance identity="B2" name="B2" type="B_Type">
<attribute Name="AttB2-1">
<value>
X
</value>
</attribute>
<instance identity="C1" name="C1" type="C_Type">
<attribute Name="AttC1-1">
<value>
X
</value>
</attribute>
</instance>
</instance>
</instance>
</instance>
Each A_Type contains several B_Types, and each B_Type contains several
C_Types and the file contains lots of A_Types. I've shown one attribute
each, but there are lots of them for each type!
what I'd like to do is load this data into a few tables with Master-Detail
Releations. So Table A would contain a row for each A_Type plus it's
attributes (with the Attribute Name as the Column Header). For a given row
selected in Table A, Table B would show each of the B_Types and it's
attributes, etc.
So, is there an easy way to get the data from the file using an
XMLTextReader or some other nifty XML tool, or is this going to be a brute
force method with regular expressions and do loops?
I'm not sure if I've supplied enough info, so if you need to know something
else before you can give me an answer, please let me know!! If it's going to
be brute force, that's fine, but I'd hate to spend a few days coding, only
later to find out that there was a quick way to do this!
TIA
Lee
Comment