[.Net 2.0] XML -> DataSet - iteration issue

R

Rob Meade

Hi all,

I have the following xml file...

<?xml version="1.0" encoding="utf-8" ?>

<Assembly>

<!--
' The name of the product/application/resource.
' Value is required
-->

<Product>UHBristol Intranet Application Template</Product>

<!--
' A description of the product, what its used for, by who, non technical
' Value is required
-->

<Description>Template for all future UHBristol Intranet
Applications.</Description>

<!--
' The first year of copyright, ie, the year the product was released
' Value is required
-->

<FirstYearOfCopyright>2008</FirstYearOfCopyright>

<!--
' Copyright text to be displayed on template
' Value is required
-->

<Copyright>UHBristol [ University Hospitals Bristol NHS Foundation
Trust ]. All rights reserved.</Copyright>

<!--
' Version information for an assembly consists of the following four
values:
'
' Major Version
' Minor Version
'
' Example: 1.1
-->

<Version>1.0</Version>

<History>
<Release>
<Version>1.0</Version>
<Description>Initial Release</Description>
<Changes>
<Change></Change>
<Change></Change>
<Change></Change>
</Changes>
</Release>

<Release>
<Version>0.8</Version>
<Description>Pilot Beta</Description>
<Changes>
<Change></Change>
</Changes>
</Release>

</History>

</Assembly>

I've just come across the dataset.ReadXml method and like the look of it as
a good way of grabbing the content of the xml file ready to iterate/parse.

I've had a look at the contents of the dataset after reading in the above
file....and I'm happy with most of it... apart from the 5th table that it
creates which is the "Change" table.... based on the above it will contain 4
rows... how do I determine which of those 4 rows (ie, each <change></change>
node above) belong to the appropriate <Release> node?

I saw a ParentRelations.ParentTable - but if I have to put in a hell of a
load of checks to check which table we're working through then its not far
from the piles of code I'd already written (and will probably now be
binning) that was parsing the xml file node by node previously (without the
dataset)..

I was hoping to just For Each DataRow In DataTable.Rows kinda thing to get
the information I require...

Any information would be appreciated...

Kind regards

Rob Meade
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top