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

Re: [XSL-FO] current month and year in the footer

Expand Messages
  • sachin rathod
    I want to a function or tag which i can write so that when i create a RTF( using jfor) from this FO it should display the current month and year in RTF
    Message 1 of 5 , May 3, 2005
    • 0 Attachment
      I want to a function or tag which i can write so that when i create a RTF( using jfor) from this FO it should display the current month and year in RTF footer. I do not want to hard code as the FO file will be placed in App Server, which we wont be able to modify once the application server is started.

      "J.Pietschmann" <j3322ptm@...> wrote:sachin rathod wrote:
      > How do i write current month and year in the footer of FO?

      Put it as content into the footer of the FO document.
      Details depend on how you actually generate the FO.

      J.Pietschmann


      ---------------------------------
      Yahoo! Groups Links

      To visit your group on the web, go to:
      http://groups.yahoo.com/group/XSL-FO/

      To unsubscribe from this group, send an email to:
      XSL-FO-unsubscribe@yahoogroups.com

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com

      [Non-text portions of this message have been removed]
    • Mike Trotman
      As fas as I know - the only way to include dynamic content in the output from a static FO file is through an element which gets a
      Message 2 of 5 , May 3, 2005
      • 0 Attachment
        As fas as I know - the only way to include dynamic content in the output
        from a static FO file is through an <fo:external-graphic> element which
        gets a dynamically created image from a server.

        E.g. <fo:external-graphic
        src='url(http://www.server.com/images/bin/now.pl?type=png'/>

        I'm not sure if this would work with JFor - and all the font work etc.
        would need to be done in the graphic.
        You might be able to get better text using an SVG - but I haven't tried
        that.

        Dynamic FO output is really more in the XSL part of the spec than the FO
        part.


        You can be much more flexible if you can produce the FO from an XSLT
        transformation each time.
        Using a similar approach to 'external-graphic' you can then call server
        scripts to return XML containing whatever you like
        and insert these into your FO output.

        If there's only a small part of your FO you want to make dynamic then
        you could also further improve this flexibility by building a simple
        summary.xml file that says which other FO files you want to include
        and then process that through XSLT.

        E.g. Here is a XSL file I use for combining other FO files into a
        single PDF.
        The key lines are 33,34,42 - 45.
        If there is a particular set of FO elements you want to substitute
        content for then you can put in a matching template (using mode='FO')
        and substitute the content you want.(possibly uisng the 'document()'
        approach above.

        The advantage with this approach is that you only need to change a
        fairly simple summary file if you want to create different content
        and the same XSLT can be used on any summary file using the same XML syntax.

        1 <xsl:stylesheet version="1.1"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        2 xmlns:fo="http://www.w3.org/1999/XSL/Format"
        3 xmlns:dl='http://www.datalucid.com/'
        4 >
        5 <xsl:output method="xml" encoding="UTF-8"
        omit-xml-declaration='yes' indent='yes'/>
        6 <xsl:decimal-format name="nan0" NaN="0"/>
        7
        8 <!-- 11.27in = 29cm ??? -->
        9 <xsl:param name='PAGEWID_CM' select='29'/>
        10 <xsl:include href='dl_dotags.xsl'/>
        11 <!--
        ############################################################ -->
        12 <!-- XSLT for DLXML - Author: Mike Trotman - 03/10/2002 -->
        13 <!--
        ############################################################ -->
        14 <xsl:template match="/">
        15
        16 <fo:root xmlns:fo='http://www.w3.org/1999/XSL/Format'>
        17
        18 <fo:layout-master-set>
        19 <fo:simple-page-master master-name='first'>
        20 <xsl:call-template name='DL_FO_ATTR'><xsl:with-param
        name='RULE' select='"page"'/></xsl:call-template>
        21 <fo:region-body>
        22 <xsl:call-template name='DL_FO_ATTR'><xsl:with-param
        name='RULE' select='"region-body"'/></xsl:call-template>
        23 </fo:region-body>
        24 <fo:region-before>
        25 <xsl:call-template name='DL_FO_ATTR'><xsl:with-param
        name='RULE' select='"region-before"'/></xsl:call-template>
        26 </fo:region-before>
        27 <fo:region-after>
        28 <xsl:call-template name='DL_FO_ATTR'><xsl:with-param
        name='RULE' select='"region-after"'/></xsl:call-template>
        29 </fo:region-after>
        30 </fo:simple-page-master>
        31 </fo:layout-master-set>
        32
        33 <xsl:apply-templates select="SECTIONS/SECTION"/>
        34 <xsl:apply-templates select="TABLE" mode='TABLE'/>
        35 </fo:root>
        36 </xsl:template>
        37 <!--
        ############################################################ -->
        38 <xsl:template match="SECTION">
        39 <xsl:variable name='sid' select='count(preceding::SECTION)'/>
        40 <xsl:for-each select='TABLES/TABLE'>
        41 <xsl:choose>
        42 <xsl:when test='TABFIL/@href_fo'>
        43 <xsl:message>FO Table lookup <xsl:value-of
        select="@tableno"/></xsl:message>
        44 <xsl:apply-templates
        select='document(TABFIL/@href_fo)/*' mode='FO'/>
        45 </xsl:when>
        46 </xsl:choose>
        47 </xsl:for-each>
        48 </xsl:template>
        49 <!--
        ############################################################ -->
        50 <xsl:template match='fo:root' mode='FO'>
        51
        52 <xsl:copy-of select='./fo:page-sequence'/>
        53
        54 </xsl:template>
        55 <!--
        ############################################################ -->
        56 </xsl:stylesheet>


        Not sure if that helps in your situation - but it works for me.

        sachin rathod wrote:

        >I want to a function or tag which i can write so that when i create a RTF( using jfor) from this FO it should display the current month and year in RTF footer. I do not want to hard code as the FO file will be placed in App Server, which we wont be able to modify once the application server is started.
        >
        >"J.Pietschmann" <j3322ptm@...> wrote:sachin rathod wrote:
        >
        >
        >>How do i write current month and year in the footer of FO?
        >>
        >>
        >
        >Put it as content into the footer of the FO document.
        >Details depend on how you actually generate the FO.
        >
        >J.Pietschmann
        >
        >
        >



        --
        No virus found in this outgoing message.
        Checked by AVG Anti-Virus.
        Version: 7.0.308 / Virus Database: 266.11.2 - Release Date: 02/05/2005
      • Peter B. West
        This may be possible if the format of fields in RTF is known. I don t know it, but it is common in word processing documents to have dynamically updated
        Message 3 of 5 , May 3, 2005
        • 0 Attachment
          This may be possible if the format of "fields" in RTF is known. I don't
          know it, but it is common in word processing documents to have
          dynamically updated fields for things like the page number. They are
          presumably stored in a particular format in the file, If you can
          reproduce the data and format of that field in your RTF output, it
          should work.

          Peter

          Mike Trotman wrote:
          > As fas as I know - the only way to include dynamic content in the output
          > from a static FO file is through an <fo:external-graphic> element which
          > gets a dynamically created image from a server.
          >
          > E.g. <fo:external-graphic
          > src='url(http://www.server.com/images/bin/now.pl?type=png'/>
          >
          > I'm not sure if this would work with JFor - and all the font work etc.
          > would need to be done in the graphic.
          > You might be able to get better text using an SVG - but I haven't tried
          > that.
          >
          > Dynamic FO output is really more in the XSL part of the spec than the FO
          > part.
        Your message has been successfully submitted and would be delivered to recipients shortly.