Xml GetElementsByTagName Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following code in my progam to edit an xml file with the correct data and the code when executed on the device keeps throwing an XMLException error
Error at this line:XmlNodeList nodeList = doc.GetElementsByTagName("Security")
foreach (XmlNode node in nodeList

node.FirstChild.InnerText = userName
node["Password"].InnerText = password
node.LastChild.InnerText = domain

"doc" is an XML file structured like this
<Payload><Security><Username>test</Username><Password>test</Password><Domain>test</Domain></Security></Payload
Any ideas on why this is causing an error? This code runs fine on the computer (not in the compact framework) but I'm pretty sure all the functions are inthe compact framework. It compiles and deploys fine
thanks
greg
 
And what are the XmlException details?

--
Alex Feinman
---
Visit http://www.opennetcf.org
edwardraoul said:
I have the following code in my progam to edit an xml file with the
correct data and the code when executed on the device keeps throwing an
XMLException error:
Error at this line:XmlNodeList nodeList = doc.GetElementsByTagName("Security");
foreach (XmlNode node in nodeList)
{
node.FirstChild.InnerText = userName;
node["Password"].InnerText = password;
node.LastChild.InnerText = domain;
}
"doc" is an XML file structured like this:
test</Domain></Security></Payload>
Any ideas on why this is causing an error? This code runs fine on the
computer (not in the compact framework) but I'm pretty sure all the
functions are inthe compact framework. It compiles and deploys fine.
 
Back
Top