Example #1
0
 public static XAttribute Attribute_NamespaceSafe(this XElement parent, XName attrName, XNamespace documentDefaultNamespace)
 {
     if(attrName.Namespace == documentDefaultNamespace)
         attrName = attrName.RemoveNamespace();
     return parent.Attribute(attrName);
 }
Example #2
0
 public static IEnumerable<XAttribute> Attributes_NamespaceSafe(this XElement parent, XName attrName)
 {
     if (attrName.Namespace == parent.Name.Namespace)
         attrName = attrName.RemoveNamespace();
     return parent.Attributes(attrName);
 }