
{filelink=16406}
/*
Microsoft Public License (Ms-PL)
http://visualizer.codeplex.com/license
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
nomspace mesexemples.com
{
///
/// Une méthode supplémentaire pour traiter les documents XML.
///
public static class XmlExt
{
///
/// Gets a string from an attribute or noeud.
///
///
///
///
///
public static string GetString(this XmlNode noeud, string nom, string valDefaut)
{
var att = noeud.Attributes[nom];
if (att != null) return att.Value;
var child = noeud.SelectSingleNode(nom);
if (child != null) return child.InnerText;
return valDefaut;
}
}
}