<?php
/**
* Class : BowHTMLNode
* Developed by Jonas Eriksson
* @copyright 2003 BICOM KB
**/
require_once('BowHTMLDocument.inc.php');
class BowHTMLNode extends BowAbstractNode
{
/*Instance variables*/
var $name = "";
var $bowNodeAttributes;
var $children;
/*Constructor*/
function BowHTMLNode()
{
$this->bowNodeAttributesSet(new BowList());
$this->childrenSet(new BowList());
}
/*Setter and getter for $name*/
function name() { return $this->name; }
function nameSet( $aName ) { $this->name =& $aName; }
/*Setter and getter for $bowNodeAttributes*/
function &bowNodeAttributes() { return $this->bowNodeAttributes; }
function bowNodeAttributesSet( $someNodeAttributes ) { $this->bowNodeAttributes =& $someNodeAttributes; }
/*Setter and getter for $children*/
function &children() { return $this->children; }
function childrenSet( $someChildren ) { $this->children =& $someChildren; }
/*Append a node ID to the children array and set my parent node id*/
function appendTagTo(&$newTag, $existingTagId)
{
$children =& $this->children();
$children->addElement($newTag->id);
$this->childrenSet($children);
$newTag->parentNodeSet($existingTagId);
}
function addAttribute($name, $value)
{
$attributes =& $this->bowNodeAttributes();
$attributes->addElement($value, $name);
$this->bowNodeAttributesSet($attributes);
}
}
?>