private static GetOptionalElementValue ( System.Xml.Linq.XElement element, string localName, string namespaceName = null ) : string | ||
element | System.Xml.Linq.XElement | |
localName | string | |
namespaceName | string | |
Результат | string |
private static string GetOptionalElementValue(XElement element, string localName, string namespaceName = null)
{
XElement child;
if (String.IsNullOrEmpty(namespaceName))
{
child = element.Element(localName);
}
else
{
child = element.Element(XName.Get(localName, namespaceName));
}
return child != null ? child.Value : null;
}