Click here to Skip to main content
12,302,764 members (69,907 online)
Click here to Skip to main content

Using Extension Methods To Avoid XML Problems

, 22 May 2010 CPOL
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...

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