parsing the file using touch xml in iphone
<pre><code>&lt;ArrayOfBar xmlns="http://schemas.datacontract.org/2004/07/BarometerModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;Bar&gt;
    &lt;BarId&gt;1&lt;/BarId&gt;
    &lt;BarType&gt;Pub&lt;/BarType&gt;
    &lt;Location&gt;West Ocean City&lt;/Location&gt;
    &lt;LocationId&gt;1&lt;/LocationId&gt;
    &lt;Name&gt;Mickey Fine Bar &amp; Grill&lt;/Name&gt;
    &lt;Phone&gt;9884020844&lt;/Phone&gt;
    &lt;Rating&gt;3.50&lt;/Rating&gt;
    &lt;Status&gt;Open&lt;/Status&gt;
    &lt;TypeId&gt;1&lt;/TypeId&gt;
    &lt;Website&gt;www.mickeyfinebar.com&lt;/Website&gt;
  &lt;/Bar&gt;
&lt;/ArrayOfBar&gt;`
</code></pre>

<p>how to parse this file using touch XML?</p>

<p>and this is the code I am using: </p>

<pre><code>-(void) grabRSSFeed:(NSString *)blogAddress {

// Initialize the blogEntries MutableArray that we declared in the header
blogEntries = [[NSMutableArray alloc] init];    

// Convert the supplied URL string into a usable URL object
NSURL *url = [NSURL URLWithString: blogAddress];

// Create a new rssParser object based on the TouchXML "CXMLDocument" class, this is the
// object that actually grabs and processes the RSS data
CXMLDocument *rssParser = [[[CXMLDocument alloc] initWithContentsOfURL:url options:0 error:nil] autorelease];

// Create a new Array object to be used with the looping of the results from the rssParser
NSArray *resultNodes = NULL;

// Set the resultNodes Array to contain an object for every instance of an  node in our RSS feed
resultNodes = [rssParser nodesForXPath:@"//Bar" error:nil];

// Loop through the resultNodes to access each items actual data
for (CXMLElement *resultElement in resultNodes) {

    // Create a temporary MutableDictionary to store the items fields in, which will eventually end up in blogEntries
    NSMutableDictionary *blogItem = [[NSMutableDictionary alloc] init];

    // Create a counter variable as type "int"
    int counter;

    // Loop through the children of the current  node
    for(counter = 0; counter &lt; [resultElement childCount]; counter++) {

        // Add each field to the blogItem Dictionary with the node name as key and node value as the value
        [blogItem setObject:[[resultElement childAtIndex:counter] stringValue] forKey:[[resultElement childAtIndex:counter] name]];
    }

    // Add the blogItem to the global blogEntries Array so that the view can access it.
    [blogEntries addObject:[blogItem copy]];
}
</code></pre>

<p>}</p>

<pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [blogEntries count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}

// Set up the cell
int blogEntryIndex = [indexPath indexAtPosition: [indexPath length] -1];
cell.textLabel.text=[[blogEntries objectAtIndex: blogEntryIndex] objectForKey: @"BarId"];
return cell;
}
</code></pre>

<p>can any one please help me how to parse it?</p>
