Click here to Skip to main content
15,895,777 members
Articles / Programming Languages / XML

Using Extension Methods To Avoid XML Problems

22 May 2010CPOL 2K   1  
public static string GetValue(this XElement root, string name, string defaultValue) { XElement el = root.Element(name); return el == null ? defaultValue : el.Value; }I agree, Contains can be omitted, using instead root.Element(name)!=nullsince...
We're sorry, but the article you are trying to view was deleted at 28 Sep 2015.

Please go to the XML Table of Contents to view the list of available articles in this section.