예제 #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);
            }
        }
예제 #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);
     }
 }
예제 #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);
        }
예제 #4
0
		public void setIdAttributeNode(DOMAttr attribute, bool isId)
		{
			PhpException.Throw(PhpError.Warning, Resources.NotYetImplemented);
		}
예제 #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;
		}
예제 #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;
			}
		}
예제 #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;
			}
		}
예제 #8
0
 public void setIdAttributeNode(DOMAttr attribute, bool isId)
 {
     PhpException.Throw(PhpError.Warning, Resources.NotYetImplemented);
 }