AddElementWithId() private method

private AddElementWithId ( string id, XmlElement elem ) : void
id string
elem XmlElement
return void
Beispiel #1
0
        internal void ResetParentInElementIdAttrMap(string oldVal, string newVal)
        {
            XmlElement  parent        = base.parent as XmlElement;
            XmlDocument ownerDocument = base.parent.OwnerDocument;

            ownerDocument.RemoveElementWithId(oldVal, parent);
            ownerDocument.AddElementWithId(newVal, parent);
        }
        internal void ResetParentInElementIdAttrMap(string oldVal, string newVal)
        {
            XmlElement parentElem = parent as XmlElement;

            Debug.Assert(parentElem != null);
            XmlDocument doc = parent.OwnerDocument;

            Debug.Assert(doc != null);
            doc.RemoveElementWithId(oldVal, parentElem); //add the element into the hashtable
            doc.AddElementWithId(newVal, parentElem);
        }
        internal void ResetParentInElementIdAttrMap(string attrLocalName, string attrNS, string oldVal, string newVal)
        {
            XmlElement parentElem = parent as XmlElement;

            Debug.Assert(parentElem != null);
            XmlDocument doc = parent.OwnerDocument;

            Debug.Assert(doc != null);
            XmlName attrname = doc.GetIDInfoByElement(parentElem.XmlName);

            if (attrname != null && attrname.LocalName == attrLocalName && attrname.NamespaceURI == attrNS)
            {
                doc.RemoveElementWithId(oldVal, parentElem); //add the element into the hashtable
                doc.AddElementWithId(newVal, parentElem);
            }
        }