If "prod-id" in the area tree works for you (as suggested by Georg), that's fine. However, that doesn't give you the absolute position of the element on the page. You can calculate that position from the various attributes if you can figure it out. But that's quite tricky and undocumented. Usually, that's the renderers' job and encoded in their source code. So you'd be building half a renderer just for that.
The new intermediate format [1] I'm working [2] on uses a system more like SVG (absolute coordinates plus nested transformation matrices) where it's pretty easy to calculate the absolute position on the page. But there's no support, yet, for identifying an element from the FO. We may add that later. At any rate, if you want to pass through custom attributes, that's pretty easy for most FO elements: Just specify your own attributes in a non-FO namespace. You may have to let FOP know about that namespace using FopFactory.ignoreNamespace(String). Alternatively, register an ElementMapping object with FOP. These extension attributes should make it to the area tree XML and to a certain degree also into the new intermediate format. Anyway, before you go down such a road, I'd re-verify that you can't implement that requirement using plain XSL-FO. [1] http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign [2] http://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign On 12.01.2009 11:33:43 Maximilian Gaerber wrote: > Hi, > > is there an (easy) way to add custom attributes to a FO document that > would be preserved through the whole FOP process? > > The idea is to get feedback about on what page (and position) a certain > block or other other content *would* come out in the output format (e.g. > PDF): Let's say I've got a block that should always be displayed on the > first half of the page. Now, when I generate, I'd have to search for > this block in the area tree in order to determine it's position... but > so far I don't know how to mark/identify such a block. Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
