You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gil Winkelman <gi...@intuitek.com> on 2001/01/04 01:54:45 UTC

Newbie Question about XSP

Hello All,

I have a quick question about XSP and embedding in a stylesheet that also
uses FOP. I am trying to do a simple for-each loop and with each loop test
to see if there is a change in a value. If there is I want to start a new
page. If there isn't I want to group the values on the same page. I am
assuming the data is coming from the database sorted. My problem is that
when I try to run the if statement if always is false. CompareSupplier
returns a boolean based on the current supplier and the one I set.
If I try to getSupplier as shown below I get a literal value back. I've
tried both all of the following:

    <xsp:expr>
        getSupplier();
    </xsp:expr>

    <xsp:logic>
        <xsp:expr>
        getSupplier();
        </xsp:expr>
    </xsp:logic>



<xsl:template match="results">

<xsl:for-each select="Request">

<xsp:logic>
    setSupplier(<xsl:value-of select="Supplier"/>)
</xsp:logic>
....
....
...

<fo:block>
    Current Supplier = <xsl:value-of select="Supplier"/>
</fo:block>
<fo:block>
    Supplier stored =
    <xsp:logic>
        getSupplier();
    </xsp:logic>
</fo:block>

<xsp:logic>
    
    if (!compareSupplier(<xsl:value-of select="Supplier"/>)){
    <xsp:content>
    <fo:block font-size="16pt"
            font-family="sans-serif"
            space-after.optimum="15pt"
            text-align="centered"
            break-before="page">
    <xsl:value-of select="//header"/>
    <xsl:apply-templates select="//top"/>
      </fo:block>
    </xsp:content>
</xsp:logic>
</xsl:for-each>
</xsl:template>