Andreas,

I understand my stylesheet snippets are amature because that's just what I was 
when I started the project, an XSL amature. I am open to any and all 
suggestions for improvement but understand that I am most interested in 
fixing the pressing memory problem at hand. See my answer to Dave who was 
dead on. I'm a little hesitant to post my nasty XSL stylesheet in entirety as 
it may require explaining that is not directly related to my problem and 
sidetrack the issue. On the other hand I'm guessing there are experts here 
that could probably look through the unrelated fluff and find out where I'm 
going wrong. I'd probably have to work out an XML schema or something to go 
along with the stylesheet too. I had a tool that could generate that for me 
but it expired. (See I'm sidetracked already!) Anyway, thank you all for 
showing interest in my dilemma. I really need some good adivce on how to 
control page breaks programmatically since it seems I'm stuck doing it this 
way.

Here's a brief synopsis of how things work. A group of Java classes run 
multiple queries to pull data from the db and into a result set. Some more 
Java code transforms the data into XML (sort of an intermediate form for the 
report). my stylesheet then takes the resultset tranformed into XML and 
transforms it again into FO for the FOP engine. The data can be voluminous 
and we are looking into streamlining the process. My major bottleneck now has 
been the stylesheet creating FO that appears to be choking the FO engine. In 
a perfect world I'd love to just dump the report in one page sequence element 
and have the engine sort it out but it doesn't appear to work well that way. 
Thanx for all suggestions.

-- 
Clifton C. Craig, Software Engineer
[EMAIL PROTECTED]
On Monday 05 December 2005 5:47 pm, Andreas L Delmelle wrote:
> On Dec 5, 2005, at 21:43, Clifton Craig wrote:
>
>
> Hi,
>
> > I'm writing a report transform usinf XSLT for XSL-FO and I have
> > some basic
> > questions. What's the best way to code for multiple page sequences.
> > For
> > example I have some static content that I like to keep in the
> > header and
> > footers and I guess it doesn't matter but I'd like to reuse chunks
> > of XML-FO
> > for that purpose rather than replicating it to the result tree.
> > What I mean
> > is I have some XSL for a page sequence that looks like this:
>
> I'm unsure what exactly you mean, but I guess you could define parts
> of the static-content (the ones you're going to reuse) as
> xsl:variables --some maybe even in another, included/imported
> stylesheet to keep them separated for maintainability--, and insert
> them into the result tree using xsl:copy-of.
>
> Say,
>
> <xsl:variable name="static-one">
>    <fo:block font-family="{$FONT-DEFAULT}">
>      <fo:block text-align="center" font-size="12pt" font-weight="bold">
>        <!-- Be very careful about the below XPath expression, as it
> will not
>             necessarily be evaluated in the same context it currently
> is...
>             If the expression actually evaluates differently for
> different
>             page-sequences, this can't be put in a global variable,
> IIC -->
>        <xsl:value-of select="snapshot/title" />
>      </fo:block>
>    ...
> </xsl:variable>
>
> Then further on you can go:
>
> <fo:page-sequence master-reference="snapshot-pages">
>    <fo:static-content flow-name="header">
>      <!-- some dynamic static content, specific to *this* page-
> sequence -->
>      <xsl:copy-of select="$static-one" />
>    </fo:static-content>
> ...
>
> Also, the following seems a little fishy, although I have way too
> little context here to form an accurate idea of why you're using
> named templates instead of matching ones.
>
> > <xsl:call-template name="group-headings">
> >   <xsl:with-param name="group" select="snapshot/data/group[1]"/>
> > </xsl:call-template>
> > <xsl:call-template name="column-headers">
> >   <xsl:with-param name="meta" select="/snapshot/data/meta"/>
> > </xsl:call-template>
>
> I don't know exactly what happens to these parameters, but if I see
> this, it makes me think: "Why not use
>
> <xsl:apply-templates select="snapshot/data/group[1]" />
> <xsl:apply-templates select="/snapshot/data/meta" />
>
> ?"
>
> If the column-headers template actually needs to applied to several
> different types of nodes (other than meta), you could redefine it from
>
> <xsl:template name="column-headers">
>
> to
>
> <xsl:template match="meta | ... | ...">
>
> <snip />
>
> > What bothers me even more is since I'm programmatically controlling
> > new pages
> > is there a better way to handle this type of processing?
>
> Can you explain a bit further what you mean by 'programmatically
> controlling new pages'? If we get to see a bit more, maybe we can
> offer you a better way...
>
> > Right now it looks like I'll have to keep a line count in my
> > stylesheet to
> > detect when I should programmatically start new pages.
>
> Why? Is the processor's page-breaking algorithm insufficient for some
> reason? Can't you use XSL-FO's break-* properties to control this?
>
>
> HTH!
>
> Cheers,
>
> Andreas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to