XMl: How to convert IEnumerable<XmlNode> to XmlNodeList ?
XMl: How to convert IEnumerable<XmlNode> to XmlNodeList ?
6 Replies
you can't. but you can go the opposite way and get an
IEnumerable<XmlNode>
from an XmlNodeList
by doing:
so I essentially am forced into doing this whole crap?
?
¯\_(ツ)_/¯
I don't use the old
XmlNode
stuff. it's the first draft that belongs in net1.0 and barely net2.0.
XDocument
and XNode
are the better technologies regardless.
unless you're dealing with a really old library that requires XmlNode
, I'd torch anythign that touches XmlNode
unless you're dealing with a really old library that requires XmlNode
yeah, that's the hole i'm in ;_;
thank you!name and shame! haha
if it's public, we might be able to give you info on a better one
if it's not public, then yeah, you're hosed
XmlNode came out before generics were in C#. It was also tied to attempt to match the spec for xml document from W3C, and is burdened by a need to act as a mutable structure with events. XDocument came out with LINQ and was unbound by other constraints.