Click here to Skip to main content
13,446,805 members (42,992 online)
Click here to Skip to main content

Using Extension Methods To Avoid XML Problems

, 22 May 2010
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 Programming Tips Table of Contents to view the list of available articles in this section.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03-2016 | 2.8.180318.2 | Last Updated 22 May 2010
Article Copyright 2010 by Mr.PoorEnglish
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid