Esempio n. 1
0
        /// <seealso cref="Comzept.Genesis.Tidy.Dom.Element.setAttributeNode">
        /// </seealso>
        public virtual Comzept.Genesis.Tidy.Dom.Attr setAttributeNode(Comzept.Genesis.Tidy.Dom.Attr newAttr)
        {
            if (newAttr == null)
            {
                return(null);
            }
            if (!(newAttr is DOMAttrImpl))
            {
                throw new DOMExceptionImpl(DOMException.WRONG_DOCUMENT_ERR, "newAttr not instanceof DOMAttrImpl");
            }

            DOMAttrImpl newatt = (DOMAttrImpl)newAttr;

            System.String name = newatt.avAdaptee.attribute;
            Comzept.Genesis.Tidy.Dom.Attr result = null;

            AttVal att = this.adaptee.attributes;

            while (att != null)
            {
                if (att.attribute.Equals(name))
                {
                    break;
                }
                att = att.next;
            }
            if (att != null)
            {
                result      = att.Adapter;
                att.adapter = newAttr;
            }
            else
            {
                if (this.adaptee.attributes == null)
                {
                    this.adaptee.attributes = newatt.avAdaptee;
                }
                else
                {
                    newatt.avAdaptee.next   = this.adaptee.attributes;
                    this.adaptee.attributes = newatt.avAdaptee;
                }
            }
            return(result);
        }
Esempio n. 2
0
        /// <seealso cref="Comzept.Genesis.Tidy.Dom.Element.removeAttributeNode">
        /// </seealso>
        public virtual Comzept.Genesis.Tidy.Dom.Attr removeAttributeNode(Comzept.Genesis.Tidy.Dom.Attr oldAttr)
        {
            if (oldAttr == null)
            {
                return(null);
            }

            Comzept.Genesis.Tidy.Dom.Attr result = null;
            AttVal att = this.adaptee.attributes;
            AttVal pre = null;

            while (att != null)
            {
                if (att.Adapter == oldAttr)
                {
                    break;
                }
                pre = att;
                att = att.next;
            }
            if (att != null)
            {
                if (pre == null)
                {
                    this.adaptee.attributes = att.next;
                }
                else
                {
                    pre.next = att.next;
                }
                result = oldAttr;
            }
            else
            {
                throw new DOMExceptionImpl(DOMException.NOT_FOUND_ERR, "oldAttr not found");
            }
            return(result);
        }
Esempio n. 3
0
 /// <summary> DOM2 - not implemented.</summary>
 /// <exception cref="Comzept.Genesis.Tidy.Dom.DOMException">
 /// </exception>
 public virtual Comzept.Genesis.Tidy.Dom.Attr setAttributeNodeNS(Comzept.Genesis.Tidy.Dom.Attr newAttr)
 {
     return(null);
 }