Re: FO->Area as XSLT extension function

On Fri, March 22, 2013 10:37 am, Arved Sandstrom wrote:
> On 03/22/2013 06:50 AM, Tony Graham wrote:
>> On Fri, March 22, 2013 2:47 am, Arved Sandstrom wrote:
...
>> [1] http://xmlgraphics.apache.org/fop/1.0/intermediate.html
>> [2] http://www.w3.org/TR/xsl11/#fo_basic-link
>>
>>
> I just tried an experiment where I switched from rendering with FOP's
> MimeConstants.MIME_FOP_IF to using MimeConstants.MIME_FOP_AREA_TREE. I
> put an id attribute on a source element (a "paragraph" in my example
> XML), and as you, made sure that the stylesheet placed it on the target
> FO, in this case an fo:block.
>
> The attribute does come across when using this more verbose lower-level
> area tree format.

That's promising.  The area tree XML is described [1] as:

   ...basically a 1:1 XML representation of FOP's area tree
   as generated by the layout engine. The area tree is
   conceptually defined in the XSL-FO specification in
   chapter 1.1.2. Even though the area tree is mentioned
   in the XSL-FO specification, this part is not standardized.

Assuming we can get to having a neutral area tree serialisation, it
appears we could also "give the XMLRenderer your own TransformerHandler
instance in case you would like to do custom serialization (to a W3C DOM,
for example) and/or to directly modify the area tree using XSLT" to have
FOP produce it directly.

Regards,


Tony.

Received on Friday, 22 March 2013 12:19:34 UTC