Ok, Michael..apparently I'm too dense to see this..so if you or someone else wouldn't mind adding the /n for me in this function I would really appreciate it:
function appendChild( $NewChild ) {
if ( is_string( $NewChild ) ) {
$classes = get_declared_classes();
$classname = $NewChild;
if (! in_array( $classname, $classes ) ) {
$classname = "Node";
}
$WorkObj = new $classname;
if ( $classname == "Node" ) {
$WorkObj->Tag( $NewChild );
}
}
elseif ( is_object( $NewChild ) ) {
if ( strtolower( get_class( $NewChild ) ) == strtolower( "DomNode" ) ) {
$WorkObj = new Node;
}
else {
$WorkObj = $NewChild;
}
}
if ( (! is_subclass_of( $WorkObj, "Node" )) &&
(! strtolower( get_class( $NewChild ) ) == strtolower( "Node" ) ) ) {
user_error( "Node-Element ist vom falschen Typ ..." );
return false;
}
// Check for a DomNode-Object - Create one, if it is not there!
$this->internal_selfCheck();
// Is the new child attached to a DomNode?
if (! $WorkObj->node ) {
// New node, i can store the value of the node
$WorkObj->node = $this->node->new_child( $WorkObj->nodeName, $WorkObj->nodevalue );
// New node, so copy the stored attributes!
for ( reset( $WorkObj->attribute );
$k = key( $WorkObj->attribute );
next( $WorkObj->attribute ) ) {
$WorkObj->node->setattr( $k, $WorkObj->attribute[$k] );
}
}
else {
// Already attached to a Node!
// Create the New-Child of the same type as the new one ...
$tmpnode = $this->node->new_child( $WorkObj->nodeName, $WorkObj->nodevalue );
$this->internal_cloneNode( $tmpnode, $WorkObj->node, true );
}
$WorkObj->node = $this->node->lastchild();
return $WorkObj;
}
Thanks! Tin