GetAttributeValue() public method

Gets the value of an attribute of the Element
public GetAttributeValue ( string attributeName ) : string
attributeName string The name of the attribute
return string
コード例 #1
0
 public void BeforeParsing(XDocument document)
 {
     var rootElement = new Element(document.Root);
     var existingValue = rootElement.GetAttributeValue(FakeExtensionAttrName);
     var newValue = this.m_Text;
     if (existingValue != null) {
         newValue = existingValue + ", " + newValue;
     }
     rootElement.AddAttribute(FakeExtensionAttrName, newValue);
 }
コード例 #2
0
 private string getHref(Element element)
 {
     string href = element.GetAttributeValue("href");
     if (href == null)
     {
         Element a = element.GetFirstChildElement("a");
         if (a != null)
         {
             href = a.GetAttributeValue("href");
         }
     }
     return href;
 }