This project has moved and is read-only. For the latest updates, please go here.
1
Vote

SetID does not update attribue set

description

When assigning a value to node.Id the property calls SetId which correctly creates an Id attribute and adds it to the document NodesId dictionary via SetIdForNode, however it is never added to the nodes HtmlAttributeCollection. Therefore, when you request node.Id, GetId returns null.
    internal string GetId()
    {
        HtmlAttribute att = Attributes["id"];
        return att == null ? string.Empty : att.Value;
    }

    internal void SetId(string id)
    {
        HtmlAttribute att = Attributes["id"] ?? _ownerdocument.CreateAttribute("id");
        att.Value = id;
        _ownerdocument.SetIdForNode(this, att.Value);
        SetChanged();
    }

comments