XPathDocument doc = new
XPathDocument(@"C:\inetpub\wwwroot\test\test.xml");
XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator iter =
nav.Select("/test/translation/engword[preceding-sibling::fraword = '" +
strFraWord + "']");
Can anybody help me out with this? Any assistance would be really
appreciated.
Cheers,
Mike
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Check this out...
This example uses XmlDataDocument to load the XML and then accessing the
data using dataset...
<http://samples.gotdotnet.com/quickstart/howto/doc/Xml/LoadDataSetXMLData.aspx>
Another alternative is using ReadXml method of the Dataset...
Hope this helps...
Cheers,
Madhu
to extend the words of Madhu here is a snippet from an application of mine
which should help you, the second function is the one you should
concentrate on... this one is for ultimately populating a datagrid.
DataSet ds = ImportDataGrid.ImportSavedData();
if (ds != null) {
this.computerGrid.DataSource = ds;
} else {
this.updateMessageBox("There was a problem importing the data, the file
may not exist or there is a sytax error with the import file
(xml\\datagrid.xml)");
}
//ImportDataGrid.ImportSaveData()
public static DataSet ImportSavedData() {
DataSet ds = null;
try {
ds = new DataSet();
//this returns a (string)fileName located in the properties XML file.
ds.ReadXml(Properties.getString("data.location"));
} catch {
MessageBox.Show("The data file was not found, or it couldn't be
imported.", "File Not Found", MessageBoxButtons.OK,
MessageBoxIcon.Information);
} finally {
return ds;
}
}
HTH
Mike
http://www.blamires.co.uk/