5

This one I thought would be simple, but i really just have 1 node I need to add to a node List.

So I have XmlNode xmlNode. This node has all the information I need in it. I need to add this to XmlNodeList xmlnodeList. I know this is dumb because it's not a list, but the following code has all the parts to handle a node list and would be a pain to unwind.

Also normally I would use XmlNodeList xmlnodeList = xmlNode.FirstChild.SelectNodes however i need this entire node, not just the childnodes.

Thanks!

1 Answer 1

8

How about:

XmlNodeList xmlNodeList = xmlNode.SelectNodes(".");
Sign up to request clarification or add additional context in comments.

1 Comment

I love it when its just a simple answer, ty

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.