But as for the difference between the two, a node is more general then an
element. Anything in an XML document is a node (e.g. attributes, comments,
doctype, etc), but only tags are elements.
This error is not specific to XML conversions but .NET cannot implicitly
down-cast a variable. That is why you need to specify the cast yourself
since SelectSingleNod e returns an XmlNode object.
"Oleg Tkachenko" <oleg@NO_SPAM_P LEASEtkachenko. com> wrote in message
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
Pluto wrote:
What is the difference between XmlNode and XmlElement?
The same as between fruit and apple. XmlElement is particular type of
XmlNode.
this.appSetting sElement =
this.xml.Select SingleNode("//configuration/appSettings");
Error: Cannot implicitly convert type 'System.Xml.Xml Node' to
'System.Xml.Xml Element'
So convert it explicitly:
this.appSetting sElement =
(XmlElement)thi s.xml.SelectSin gleNode("//configuration/appSettings");
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel