public override XmlNode CloneNode(bool deep)
        {
            XmlDocument  ownerDocument = this.OwnerDocument;
            XmlAttribute attribute     = ownerDocument.CreateAttribute(this.Prefix, this.LocalName, this.NamespaceURI);

            attribute.CopyChildren(ownerDocument, this, true);
            return(attribute);
        }
Esempio n. 2
0
        /// <include file='doc\XmlAttribute.uex' path='docs/doc[@for="XmlAttribute.CloneNode"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Creates a duplicate of this node.
        ///    </para>
        /// </devdoc>
        public override XmlNode CloneNode(bool deep)
        {
            // CloneNode for attributes is deep irrespective of parameter 'deep' value
            Debug.Assert(OwnerDocument != null);
            XmlAttribute attr = OwnerDocument.CreateAttribute(Prefix, LocalName, NamespaceURI);

            attr.CopyChildren(this, true);
            return(attr);
        }