Last post Sep 29, 2013 09:42 PM by ringinter
Sep 27, 2013 09:46 AM|damon2012|LINK
when you use:
It will error if the actualy <node> is not there, which in this case it may or may not be.
How do you do a simple check for this. Can null coelesense be used. Tried it but couldnt get it to work, may have been the syntax,
Sep 28, 2013 10:10 AM|nijhawan.saurabh|LINK
Can't you do..
var asset = c.Element("Asset");
Sep 29, 2013 09:42 PM|ringinter|LINK
Here is a little example that select a specified XmlNode:
public class Sample
public static void Main()
XmlDocument doc = new XmlDocument();
//Select the book node with the matching attribute value.
XmlElement root = doc.DocumentElement;
// Selects all the title elements that have an attribute named lang
nodeToFind = root.SelectSingleNode("//title[@lang]");
if( nodeToFind != null )
// It was found, manipulate it.
// It was not found.