Loading ...
Sorry, an error occurred while loading the content.
 

repeatable-page-master-alternatives

Expand Messages
  • Cyberthymia
    HiSorry if this is a FAQ, but I couldn t find the answer in the FO spec, or on Dave Pawson s FAQ site.What happens if none of the conditions specified in
    Message 1 of 2 , Sep 17, 2002
      Hi

      Sorry if this is a FAQ, but I couldn't find the answer in the FO spec, or on
      Dave Pawson's FAQ site.

      What happens if none of the conditions specified in the
      repeatable-page-master-alternatives get chosen yet the maximum-repeats
      hasn't yet been reached?

      For example:

      <fo:repeatable-page-master-alternatives maximum-repeats="10">
      <fo:conditional-page-master-reference page-position="first" .../>
      <fo:conditional-page-master-reference odd-or-even="odd" .../>
      </fo:repeatable-page-master-alternatives>

      Does one of the conditions get chosen as a default, or are totally blank
      pages inserted until one of the conditions can get satisfied, or should the
      repeatable-page-master-alternative get broken out of and carry on with next
      page from the page-sequence-master get chosen, or is an error raised and
      every thing is stopped?

      Thanks for any help,
      Richard

      ----- Original Message -----
      From: "splifke" <ben.vanmol@...>
      To: <XSL-FO@yahoogroups.com>
      Sent: Tuesday, September 10, 2002 9:29 AM
      Subject: [XSL-FO] Xalan problem with xsl:param


      > Hello all,
      >
      > last week I designed an xslfo-stylesheet to convert an xml-document
      > to a pdf-document. To perform the transformation I used FOP from the
      > command-line. Now I am trying to embed the transformation into java
      > code, but trying to do this, I run into the following problem:
      >
      > "javax.xml.transform.TransformerException: xsl:param is not allowed
      > in this position in the stylesheet!
      > at org.apache.xalan.processor.StylesheetHandler.error
      > (StylesheetHandler.java:876)
      >
      > This error is produced on code like this (the xsl:param definition in
      > the templates is the problem):
      >
      > <xsl:template match="table">
      > <xsl:if test="caption">
      > <fo:table-caption xsl:use-attribute-sets="table.data.caption">
      > <fo:block start-indent="0em">
      > <xsl:apply-templates select="caption"/>
      > </fo:block>
      > </fo:table-caption>
      > </xsl:if>
      > <fo:table xsl:use-attribute-sets="table.data" >
      > <xsl:param name="frame">
      > <xsl:choose>
      > <xsl:when test="@frame">
      > <xsl:value-of select="@frame"/>
      > </xsl:when>
      > <xsl:otherwise>
      > <xsl:text>box</xsl:text>
      > </xsl:otherwise>
      > </xsl:choose>
      > </xsl:param>
      >
      > <xsl:param name="rule">
      > <xsl:choose>
      > <xsl:when test="@rules">
      > <xsl:value-of select="@rules"/>
      > </xsl:when>
      > <xsl:otherwise>
      > <xsl:text>all</xsl:text>
      > </xsl:otherwise>
      > </xsl:choose>
      > </xsl:param>
      >
      > <xsl:call-template name="table.frame_rules">
      > <xsl:with-param name="frame" select="$frame"/>
      > <xsl:with-param name="rule" select="$rule"/>
      > </xsl:call-template>
      > </fo:table>
      > </xsl:template>
      >
      > <xsl:template name="table.frame_rules">
      > <xsl:param-variable name="frame"/>
      > <xsl:param-variable name="rule"/>
      >
      > <xsl:choose>
      > <xsl:when test="$frame='void'">
      > <xsl:attribute name="border-bottom-style">none</xsl:attribute>
      > <xsl:if test="count(ancestor::tr/preceding-sibling::*)=0 or
      > $rule='cols' or $rule='none'">
      > <xsl:attribute name="border-top-style">none</xsl:attribute>
      > </xsl:if>
      > ...
      > </xsl:choose>
      > </xsl:template>
      >
      > What I do not understand is how to pass parameters if the previous
      > example is not valid. I found similar examples on several sites (for
      > example http://www.xml.com/lpt/a/2001/02/07/trxml9.html). On the
      > contrary I found out that the xsl:param tag is only allowed within
      > xsl:stylesheet and xsl:transform.
      >
      > Does anybody know how I can pass parameters from templates to other
      > templates without producing an invalid xsl-file?
      >
      > Thank you for your reply!
      >
      > Ben van Mol
      >
      >
      > Yahoo! Groups Sponsor
      > ADVERTISEMENT
      >
      >
      >
      > To unsubscribe from this group, send an email to:
      > XSL-FO-unsubscribe@egroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      >

      __________________________________________________
      Do You Yahoo!?
      Everything you'll ever need on one web page
      from News and Sport to Email and Music Charts
      http://uk.my.yahoo.com
    • Douglas Lovell
      You must ensure that one of the conditions will hold true. Otherwise it is an error. I don t believe the recommendation specifies the recovery behavior.
      Message 2 of 2 , Sep 17, 2002
        You must ensure that one of the conditions will hold true. Otherwise it is
        an error. I don't believe the recommendation specifies the recovery
        behavior. That may be implementation dependent. The recommendation
        suggests that you supply a last condition of the
        repeatable-page-master-alternatives that always evaluates to true. That
        is, you explicitly designate the fallback behavior.

        With power comes responsibility.

        Douglas Lovell
        XML/XSL Transformational Systems
        IBM T. J. Watson Research Center
        dcl@...
        914-784-7298 (t/l 863)




        "Cyberthymia"
        <cyberthymia@yaho To: <XSL-FO@yahoogroups.com>
        o.co.uk> cc:
        Subject: [XSL-FO] repeatable-page-master-alternatives
        09/17/2002 05:38
        AM
        Please respond to
        XSL-FO





        Hi

        Sorry if this is a FAQ, but I couldn't find the answer in the FO spec, or
        on
        Dave Pawson's FAQ site.

        What happens if none of the conditions specified in the
        repeatable-page-master-alternatives get chosen yet the maximum-repeats
        hasn't yet been reached?

        For example:

        <fo:repeatable-page-master-alternatives maximum-repeats="10">
        <fo:conditional-page-master-reference page-position="first" .../>
        <fo:conditional-page-master-reference odd-or-even="odd" .../>
        </fo:repeatable-page-master-alternatives>

        Does one of the conditions get chosen as a default, or are totally blank
        pages inserted until one of the conditions can get satisfied, or should the
        repeatable-page-master-alternative get broken out of and carry on with next
        page from the page-sequence-master get chosen, or is an error raised and
        every thing is stopped?

        Thanks for any help,
        Richard
      Your message has been successfully submitted and would be delivered to recipients shortly.