Hi everybody,
I've been trying to combine two XML documents like this:
$def = new DOMDocument( '1.0' );
$rdef = new DOMDocument( '1.0' );
$def->load( $path );
$rdef->loadXML( $info );
$r = $def->getElementsByTagName( 'repository' )->item( 0 );
$s = $rdef->getElementsByTagName( 'repository' )->item( 0 );
try {
$r->appendChild( $s );
}
catch ( DOMException $e ) {
SPConfig::debOut( get_class( $s ) );
SPConfig::debOut( $e->getMessage() );
}
The result is:
DOMElement
Wrong Document Error
So it seems to me that $rdef->getElementsByTagName( 'repository' )->item( 0 ) returns DOMElement object but the definition says it should be DOMNode object.
Any idea what is wrong about it ??
Regards, Radek