Exemple #1
0
        public object setAttributeNodeNS(DOMAttr attribute)
        {
            if (!IsAssociated)
            {
                DOMException.Throw(ExceptionCode.DomModificationNotAllowed);
                return(false);
            }

            attribute.Associate(XmlElement.OwnerDocument);

            if (XmlNode.OwnerDocument != attribute.XmlNode.OwnerDocument)
            {
                DOMException.Throw(ExceptionCode.WrongDocument);
                return(null);
            }

            XmlAttribute attr = XmlElement.Attributes[attribute.localName, attribute.namespaceURI];

            if (attr != null)
            {
                XmlElement.Attributes.Remove(attr);
                XmlElement.Attributes.Append(attribute.XmlAttribute);
                return(new DOMAttr(attr));
            }
            else
            {
                XmlElement.Attributes.Append(attribute.XmlAttribute);
                return(null);
            }
        }
Exemple #2
0
 protected override PHP.Core.Reflection.DObject CloneObjectInternal(PHP.Core.Reflection.DTypeDesc caller, ScriptContext context, bool deepCopyFields)
 {
     if (IsAssociated)
     {
         return(new DOMAttr(XmlAttribute));
     }
     else
     {
         DOMAttr copy = new DOMAttr();
         copy.__construct(this._name, this._value);
         return(copy);
     }
 }
Exemple #3
0
        public object removeAttributeNode(DOMAttr attribute)
        {
            if (!IsAssociated)
            {
                DOMException.Throw(ExceptionCode.DomModificationNotAllowed);
                return(false);
            }

            XmlAttribute attr = XmlElement.Attributes[attribute.nodeName];

            if (attr == null)
            {
                DOMException.Throw(ExceptionCode.NotFound);
                return(false);
            }

            XmlElement.Attributes.Remove(attr);

            return(attribute);
        }
Exemple #4
0
		public void setIdAttributeNode(DOMAttr attribute, bool isId)
		{
			PhpException.Throw(PhpError.Warning, Resources.NotYetImplemented);
		}
Exemple #5
0
		public object removeAttributeNode(DOMAttr attribute)
		{
			if (!IsAssociated)
			{
				DOMException.Throw(ExceptionCode.DomModificationNotAllowed);
				return false;
			}

			XmlAttribute attr = XmlElement.Attributes[attribute.nodeName];
			if (attr == null)
			{
				DOMException.Throw(ExceptionCode.NotFound);
				return false;
			}

			XmlElement.Attributes.Remove(attr);

			return attribute;
		}
Exemple #6
0
		public object setAttributeNodeNS(DOMAttr attribute)
		{
			if (!IsAssociated)
			{
				DOMException.Throw(ExceptionCode.DomModificationNotAllowed);
				return false;
			}

			attribute.Associate(XmlElement.OwnerDocument);

			if (XmlNode.OwnerDocument != attribute.XmlNode.OwnerDocument)
			{
				DOMException.Throw(ExceptionCode.WrongDocument);
				return null;
			}

			XmlAttribute attr = XmlElement.Attributes[attribute.localName, attribute.namespaceURI];
			if (attr != null)
			{
				XmlElement.Attributes.Remove(attr);
				XmlElement.Attributes.Append(attribute.XmlAttribute);
				return new DOMAttr(attr);
			}
			else
			{
				XmlElement.Attributes.Append(attribute.XmlAttribute);
				return null;
			}
		}
Exemple #7
0
		protected override PHP.Core.Reflection.DObject CloneObjectInternal(PHP.Core.Reflection.DTypeDesc caller, ScriptContext context, bool deepCopyFields)
		{
			if (IsAssociated) return new DOMAttr(XmlAttribute);
			else
			{
				DOMAttr copy = new DOMAttr();
				copy.__construct(this._name, this._value);
				return copy;
			}
		}
Exemple #8
0
 public void setIdAttributeNode(DOMAttr attribute, bool isId)
 {
     PhpException.Throw(PhpError.Warning, Resources.NotYetImplemented);
 }