views:

289

answers:

1

I have a .NET Windows Mobile 5.0 application that is used for data collection. For purposes of this question let's say it's a survey application with two screens - a survey list screen and a survey detail screen. You click on a survey in the survey list screen to display a survey detail screen with the detail information for the survey you clicked.

When the data for a new survey is saved it is serialized to a XML file in a directory on the handheld. Here's an example of the XML file format:

<GDO key=”Order”>
<PROP key=”OrderID” dataType=”System.String” value=””/>
<PROP key=”TrackingID” dataType=”System.String” value=””/>
<PROP key=”OrderType” dataType=”System.String” value=””/>
<GDO key=”Customer”>
 <PROP key=”CustomerID” dataType=”System.String” value=””/>
            <PROP key="CustomerName" dataType="System.String" value=""/>
 <PROP key=”Address” dataType=”System.String” value=””/>
 <PROP key=”City” dataType=”System.String” value=””/>
 <PROP key=”State” dataType=”System.String” value=””/>
 <PROP key=”Zip” dataType=”System.Int16” value=””/>
</GDO>
</GDO>

I need to be able to search through the all XML files in this directory to build a list of context tags for the survey list screen (using the above example let's say the context tags are OrderID and CustomerName).

I don't have any particular filename naming conventions at this time thought I've decided the filename extension will be .GDO.

I know I could use a database for this type of work but this implementation has to be file-based. Any suggestions?

A: 

There is no difference to how you would do this on the desktop, imho.

  • Iterate through all the files in the directory
  • read the XML into an XMLDocument
  • use XMLDocument.SelectNodes and an XPath query to do the search
cdonner
What about speed - this will be running on a handheld which doesn't have as powerful a processor as a desktop/laptop?
billmaya