G
Guest
I can't seem to get the right node.
here is the code:
public Division(string FileName)
{
XmlDocument doc = new XmlDocument();
doc.Load(FileName);
XmlElement root = doc.DocumentElement;
rootstr = root.ToString();
XmlNode node = root.SelectSingleNode("//Settings//Current");
currentstr = node.ToString();
}
here is the xml file:
<?xml version="1.0" encoding="utf-8" ?><Settings><Current>Alpha</Current><Alpha><Divisor>786</Divisor><Quotient>4579</Quotient><Dividend>3599094</Dividend></Alpha><Beta><Divisor>867</Divisor><Quotient>5479</Quotient><Dividend>4750293</Dividend></Beta><Gamma><Divisor>793</Divisor><Quotient>6842</Quotient><Dividend>5425706</Dividend></Gamma></Settings>
both rootstr and currentstr are System.Xml.XmlElement
How do I get Alpha?
Thanks.
here is the code:
public Division(string FileName)
{
XmlDocument doc = new XmlDocument();
doc.Load(FileName);
XmlElement root = doc.DocumentElement;
rootstr = root.ToString();
XmlNode node = root.SelectSingleNode("//Settings//Current");
currentstr = node.ToString();
}
here is the xml file:
<?xml version="1.0" encoding="utf-8" ?><Settings><Current>Alpha</Current><Alpha><Divisor>786</Divisor><Quotient>4579</Quotient><Dividend>3599094</Dividend></Alpha><Beta><Divisor>867</Divisor><Quotient>5479</Quotient><Dividend>4750293</Dividend></Beta><Gamma><Divisor>793</Divisor><Quotient>6842</Quotient><Dividend>5425706</Dividend></Gamma></Settings>
both rootstr and currentstr are System.Xml.XmlElement
How do I get Alpha?
Thanks.