|
For example, one can extract all the children from the body of the source document and copy them somewhere into the body of the target (master) document. The result is not always very clean but it can work. Example:
foreach my $element ($sourceDoc->getBody->children)
{
$targetDoc->appendBodyElement($element->copy);
}
Note that children() is an element method (not a document method) and it comes from XML::Twig, so it's not quoted in the OpenOffice::OODoc manual. This method returns all the children of the calling element in the same order as in the document. Beware: copying the body element itself could not work, because a document can't contain more than one document body.
|