Bug 45306 - fo:instream-foreign-object in fo:marker does not work
Summary: fo:instream-foreign-object in fo:marker does not work
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fo tree (show other bugs)
Version: trunk
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-29 04:19 UTC by Andreas L. Delmelle
Modified: 2012-04-01 06:38 UTC (History)
0 users



Attachments
"cheap" cloning of the foreign subtree (916 bytes, patch)
2008-07-22 03:21 UTC, Luca Furini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas L. Delmelle 2008-06-29 04:19:28 UTC
See the disabled testcase added here:
http://svn.apache.org/viewvc?rev=672617&view=rev

In current FOP Trunk, the test throws a NPE, due to AbstractRetrieveMarker not correctly cloning the foreign object. cloneSingleNode() apparently only deals with FObj and FOText, but XMLObj descends directly from FONode, so does not survive...

Changing XMLObj to extend FObj, instead of FONode, partly fixes the issue. It clones the root of the document, but does not yet descend recursively.
Comment 1 Luca Furini 2008-07-22 03:19:45 UTC
I'm wondering whether we really need to clone the whole foreign subtree, as we are quite sure (?) that it's not FO and it's self-contained ....

I'm attaching a patch that clones the foreign tree root without deleting the child pointers; I have performed a couple of tests and everything seems fine.
(actually, now I think of it, the patch is slightly sub-optimal, as we could just clone the instream-foreign-object node and share the whole foreign subtree)

If there are no remaining erroneous situations or objections I can apply the patch to the trunk.
Comment 2 Luca Furini 2008-07-22 03:21:04 UTC
Created attachment 22297 [details]
"cheap" cloning of the foreign subtree
Comment 3 Andreas L. Delmelle 2008-07-24 13:42:55 UTC
(In reply to comment #1)

(Apologies for being so late with the reply)

> I'm wondering whether we really need to clone the whole foreign subtree, as we
> are quite sure (?) that it's not FO and it's self-contained ....

Yep, now that you mention it. :-)

Seems like it could also be solved by overriding InstreamForeignObject.clone(FONode, boolean), to always pass 'false' for the boolean parameter (= removeChildren)...?

I'll look into it again later, and see what would work best.

Thanks for the feedback.
Comment 4 Jeremias Maerki 2009-01-02 08:09:38 UTC
I've recently fixed that locally without checking for an open Bugzilla entry. Now, I've stumbled over it. I guess I found yet another possible solution. I hope mine is acceptable, too.
http://svn.apache.org/viewvc?rev=730764&view=rev
Comment 5 Glenn Adams 2012-04-01 06:38:11 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed