[Phpxd-commits] CVS: phpXD/include attr.php,1.3,1.4
Status: Beta
Brought to you by:
growbal
From: Thomas D. <th...@us...> - 2001-11-26 21:11:40
|
Update of /cvsroot/phpxd/phpXD/include In directory usw-pr-cvs1:/tmp/cvs-serv31104/include Modified Files: attr.php Log Message: Index: attr.php =================================================================== RCS file: /cvsroot/phpxd/phpXD/include/attr.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** attr.php 2001/06/28 15:29:21 1.3 --- attr.php 2001/11/26 21:11:37 1.4 *************** *** 16,203 **** class Attr extends Node { ! /** ! * The name of the attribute. ! * DOM-Level 1 ! * ! * @access protected ! * @var string ! */ ! var $name; ! ! /** ! * A link to the Element object that owns this attribute. If it is unowned, ! * it equals NULL. ! * DOM-Level 2 ! * ! * @access protected ! * @var Node ! */ ! var $ownerElement; ! ! /** ! * If this attribute was explicity set in the XML source for the parent ! * element or it is a default value in the DTD (currently not supported by ! * phpXD) specified is true. ! * DOM-Level 1 ! * ! * @access protected ! * @var boolean ! */ ! var $specified; ! ! /** ! * The value of the attribute. ! * DOM-Level 1 ! * ! * @access protected ! * @var string ! */ ! var $value; ! ! /** ! * Constructor of the class. ! * ! * @access public ! */ ! function Attr() ! { ! Node::Node(); ! $this->nodeType = ATTRIBUTE_NODE; ! $this->specified = true; ! $this->name =& $this->nodeName; ! } ! ! /** ! * Returns the name of the attribute. ! * DOM-Level 1 ! * ! * @access public ! * @return string ! */ ! function getName() ! { ! return $this->name; ! } ! ! /** ! * Returns a reference to the owner of the attribute. ! * DOM-Level 2 ! * ! * @access public ! * @return Node ! */ ! function &getOwnerElement() ! { ! return $this->ownerElement; ! } ! ! /** ! * Returns true if the attribute was set explicity in the XML Source or in ! * the DTD (not supported). ! * DOM-Level 1 ! * ! * @access public ! * @return boolean ! */ ! function getSpecified() ! { ! return $this->specified; ! } ! ! /** ! * Return the value of the attribute. ! * DOM-Level 1 ! * ! * @access public ! * @return string ! */ ! function getValue() ! { ! if (isset($this->value)) ! { ! return $this->value; ! } ! } ! ! /** ! * Sets the value of the attribute ! * DOM-Level 1 ! * ! * @access public ! * @var string $value ! */ ! function setValue($value) ! { ! if (isset($this->childNodes)) ! { ! $child =& $this->firstChild; ! while (isset($child)) ! { ! removeChild($child); ! $child =& $this->firstChild; ! } ! } ! ! $new = new Text(); ! $new->nodeValue = $value; ! $new->ownerDocument =& $this->ownerDocument; ! ! $this->firstChild =& $new; ! $this->lastChild =& $this->firstChild; ! $this->nodeValue =& $this->firstChild->nodeValue; ! $this->value =& $this->nodeValue; ! } ! ! /** ! * Sets the value of the attribute (inherited function from Node interface) ! * DOM-Level 1 ! * ! * @access public ! * @var string $nodeValue ! */ ! function setNodeValue($nodeValue) ! { ! $this->setValue($nodeValue); ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @access public ! * @return NOT_SUPPORTED_ERR ! */ ! function &appendChild(&$newChild) ! { ! return NOT_SUPPORTED_ERR; ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @access public ! * @return NOT_SUPPORTED_ERR ! */ ! function &insertBefore(&$newChild, &$refChild) ! { ! return NOT_SUPPORTED_ERR; ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @access public ! * @return NOT_SUPPORTED_ERR ! */ ! function &replaceChild($newChild, $oldChild) ! { ! return NOT_SUPPORTED_ERR; ! } } - ?> --- 16,189 ---- class Attr extends Node { ! /** ! * The name of the attribute. ! * DOM-Level 1 ! * ! * @private ! * @type string ! */ ! var $name; ! ! /** ! * A link to the Element object that owns this attribute. If it is unowned, ! * it equals NULL. ! * DOM-Level 2 ! * ! * @private ! * @type Node ! */ ! var $ownerElement; ! ! /** ! * If this attribute was explicity set in the XML source for the parent ! * element or it is a default value in the DTD (currently not supported by ! * phpXD) specified is true. ! * DOM-Level 1 ! * ! * @private ! * @type boolean ! */ ! var $specified; ! ! /** ! * The value of the attribute. ! * DOM-Level 1 ! * ! * @private ! * @type string ! */ ! var $value; ! ! /** ! * Constructor of the class. ! * ! * @public ! */ ! function Attr() { ! Node::Node(); ! $this->nodeType = ATTRIBUTE_NODE; ! $this->specified = true; ! $this->name =& $this->nodeName; ! } ! ! /** ! * Returns the name of the attribute. ! * DOM-Level 1 ! * ! * @public ! * @return string ! */ ! function getName() { ! return $this->name; ! } ! ! /** ! * Returns a reference to the owner of the attribute. ! * DOM-Level 2 ! * ! * @public ! * @return Node ! */ ! function &getOwnerElement() { ! return $this->ownerElement; ! } ! ! /** ! * Returns true if the attribute was set explicity in the XML Source or in ! * the DTD (not supported). ! * DOM-Level 1 ! * ! * @public ! * @return boolean ! */ ! function getSpecified() { ! return $this->specified; ! } ! ! /** ! * Return the value of the attribute. ! * DOM-Level 1 ! * ! * @public ! * @return string ! */ ! function getValue() { ! if (isset($this->value)) { ! return $this->value; ! } ! } ! ! /** ! * Sets the value of the attribute ! * DOM-Level 1 ! * ! * @public ! * @param $value A string. ! */ ! function setValue($value) { ! if (isset($this->childNodes)) { ! $child =& $this->firstChild; ! while (isset($child)) { ! removeChild($child); ! $child =& $this->firstChild; ! } ! } ! ! $new = new Text(); ! $new->nodeValue = $value; ! $new->ownerDocument =& $this->ownerDocument; ! ! $this->firstChild =& $new; ! $this->lastChild =& $this->firstChild; ! $this->nodeValue =& $this->firstChild->nodeValue; ! $this->value =& $this->nodeValue; ! } ! ! /** ! * Sets the value of the attribute (inherited function from Node interface) ! * DOM-Level 1 ! * ! * @public ! * @param $nodeValue A String. ! */ ! function setNodeValue($nodeValue) { ! $this->setValue($nodeValue); ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @public ! * @return NOT_SUPPORTED_ERR ! */ ! function &appendChild(&$newChild) { ! return NOT_SUPPORTED_ERR; ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @public ! * @return NOT_SUPPORTED_ERR ! */ ! function &insertBefore(&$newChild, &$refChild) { ! return NOT_SUPPORTED_ERR; ! } ! ! /** ! * This inherited function from Node interface is not supported by the Attr ! * interface. ! * DOM-Level 1 ! * ! * @public ! * @return NOT_SUPPORTED_ERR ! */ ! function &replaceChild($newChild, $oldChild) { ! return NOT_SUPPORTED_ERR; ! } } ?> |