Hi Jeremias,

> you haven't told us what branch you are on. Are you on the maintenance
> branch or on FOP HEAD?

I suppose I'm working with the 0.20.5 code base...

> These hints are targeted at FOP HEAD code but some can be applied to the
> maintenance branch, too, although the whole mechanism is quite different
> there.

I didn't had the chance to look at the HEAD branch yet. Is it in an
stable/usable state?

> One thing you will have to do is creating an ElementMapping class (plus
> node subclasses, or you extend the existing ExtensionElementMapping) so
> the FOTreeBuilder can create nodes for each XML element of the various
> namespaces in the metadata part. A good example in your case is the
> bookmarks support code you can find in the org.apache.fop.fo.extensions
> package. There you have an example of an ElementMapping class
> (ExtensionElementMapping) and node classes (Bookmarks/Outline). That's
> the first step.

I tried to build up a separated DOM with the XMP data in it (similarly to
the SVG stuff). But I think there are several restrictions so that I doubt
that this could be done with the 0.20.5 sources.
Examples: 1) There is no way to define an own PropertyHandler. There are two
for FO and SVG, but they are in the fop.jar as class files. 2) The SAX
parser does not submit the prefix bindings for namespaces (e.g.
xmlns:xap="http://ns.adobe.com...";) as attributes. They are missing in the
PropertyList. 3) Leaf text nodes are not submitted to

> I'm not sure if attaching the metadata to a page-sequence is the right
> approach. The page-sequence itself isn't represented in the resulting
> PDF. You might also have multiple page-sequences in a document. So
> you should probably attach it to fo:root where it applies to the whole
> document. Attaching metadata to individual pages or objects is probably
> trickier.

Yes, you're right. Attaching it to the 'root' and to a 'block' or
'foreign-instream-object' is sounder.

> This should give you a few pointers into the code. I'm not sure if I got
> everything right, because I'm not so familiar with this part, yet.
> Hopefully, my colleagues will correct me if I wrote anything wrong.

Thanks, it helped me out. But I don't think that the 0.20.5 sources will get
me any further... Btw: Did you notice that it does not compile if you remove
the fop.jar with compiled sources from the classpath? There seem to be
inconsistent packages between the fop.jar and the actual source directory

> I hope this helps nonetheless. We're looking forward to your patches for
> FOP HEAD. ;)

Well, we'll see :-). One request: Please do not see SVG as the *only*
foreign XML vocabulary that one could embed in FO :-).

Thank you,

Reply via email to