Hi,
Sorry if this is a really basic question, I'm OK in C# but my XML is fairly basic!
I have an XML reply from an API that will resemble the following:
I am able to get what I want (reply code and message) from the XML by loading it into a dataset myDataset.ReadXml(xmlString) and then looking at myDataset.Tables[0].Rows[0]["Code"], but am fairly certain this is not the best way to do it!
I also have an XSD document that fully describes the message (this message is a very basic example of what could be returned) but am unsure how to use it.
My current thoughts are I should probably be using XPath? Is this correct and can anyone provide an example?
Thanks in advance,
Graeme
"Just beacuse you're paranoid, don't mean they're not after you
Sorry if this is a really basic question, I'm OK in C# but my XML is fairly basic!
I have an XML reply from an API that will resemble the following:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?><GV8APIREPLIES xmlns="gv8api-trayport-com"><REPLY Code="2" Message="Network Error - Can not connect to server." Reason=""/></GV8APIREPLIES>
I am able to get what I want (reply code and message) from the XML by loading it into a dataset myDataset.ReadXml(xmlString) and then looking at myDataset.Tables[0].Rows[0]["Code"], but am fairly certain this is not the best way to do it!
I also have an XSD document that fully describes the message (this message is a very basic example of what could be returned) but am unsure how to use it.
My current thoughts are I should probably be using XPath? Is this correct and can anyone provide an example?
Thanks in advance,
Graeme
"Just beacuse you're paranoid, don't mean they're not after you