extensions to FO

I brought this subject up on the FOP-dev list about a month and a half ago,
but I'm closer to actually implementing something which would require adding
new elements to an xsl fo file and wanted to see if there is any concensus
about how to do it.

The general need is to include some structural, non-layout information in an
FO file in order to keep some of the original XML document's information
when processing through a FO processor like FOP. The use-case I'm thinking
of is outline headings for PDF bookmarks.

I couldn't find anything which addresses this very well in the candidate
recommendation. Basically, I was thinking of something along the lines of
the following:

<fop:toc label="Introduction">
  <fo:block id="sect-intro">
   Section 1: Introduction
  </fo:block>
  <fo:block>
    Some text for the section
  </fo:block>
  <fop:toc label="subsection">
    <fo:block>
     Section 1.1: subheading
    </fo:block>
  </fop:toc>
</fop:toc>

I wonder if the FO spec would allow for such a structure of elements from
other namespaces wrapping elements from the FO namespace similar to how XSLT
allows result elements to wrap XSLT elements. It seems like this is possible
from section 2.1 of the spec, but it's unclear of what specifically "Tree
Construction" refers to in the XSLT spec. Is it referring to section 7,
"Creating the Result Tree"? 

Keeping structural information from the original XML might also be done via
extension attributes in a different namespace as allowed by section 2.2 of
the candidate rec. Does anyone have any opinions of which would be better?
The outlines use-case requires a hierarchy of elements such as in the above
example. In that example, all the fo:blocks are siblings, but the fop:toc
elements have a parent-child relationship. For this reason, I like the
extension elements version rather than extension attributes.

Another use case I can think of off-hand are PDF's structural tags such as
heading and paragraph and such which can be tagged in the PDF.  When you're
converting a DocBook tagged file into FO, you lose most, if not all, of the
semantic information, and have just visual and aural presentation
information left.

-Kelly
--
Kelly A. Campbell                       Software Engineer
<camk@channelpoint.com>                 ChannelPoint, Inc.
<camk@merlotxml.org>                    Colorado Springs, Co.

Received on Friday, 2 February 2001 13:29:14 UTC