Hello,
I'm trying to join several ODT files (one page each) into a single document containing all of them, one per page. After spending some time on the documentation I ended with the following code, which at a first glance does what I need:
$oodoc1->appendElement(
'//office:body',
0,
$oodoc2->exportXMLElement( '//office:text' )
);
This code exports the <office:text> node from $oodoc2 and appends it, as a new child, into node <office:body> of $oodoc1. This way, the generated document gets two <office:text> nodes.
Well, it works and I can open the merged document (~60 files joined) in an OpenOffice application, but the point is that I'm not sure it conforms to the ODF schema: shouldn't the <office:text> node be unique? Moreover, I would need the whole document be somewhat "reorganized" (styles and alike), but the "reorganize" method throws an error message saying it's no longer implemented.
Please does anybody know a cleaner way to do such document joins? Google didn't help. Thanks a lot.