I am trying to put together a report and have been learning fop and xsl. I have attached the xsl and xml that I am writing. My question is "why don't the last two lines in this setup appear?" That is, why doesn't the data line show up nor the summary line. The business unit title line does show up. These three lines are separate tables in the template "business_units".

I **must** use version .20-5. I am designing this with as much use of loops as I can, because I don't, a priori, know how many business units I will have nor how many lines within a business unit not how many companies for each business unit. The end goal of this is to write code to generate the xml from data and use the xsl that will handle the general case.

Thanks for any help.
<?xml version="1.0" encoding="utf-8"?>
<print-compliance>
	<header>
		<grey>#C0C0C0</grey>
		<report_name>U.S. - NOVEMBER 2007 CONTRACT NON - COMPLIANCE REPORT</report_name>
		<fullwidth>700pt</fullwidth>
		<supplier>
			<supplier_name>COMPANY #1</supplier_name>
			<name>Reprographics</name>
			<bg_color>rgb(255,190,160)</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #2</supplier_name>
			<name>Cylinder Gas</name>
			<bg_color>#C0C0C0</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #3</supplier_name>
			<name>LTL Freight</name>
			<bg_color>rgb(255,190,160)</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #4</supplier_name>
			<name>Office Supplies</name>
			<bg_color>#C0C0C0</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #5</supplier_name>
			<name>Direct Material</name>
			<bg_color>rgb(255,190,160)</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #6</supplier_name>
			<name>Direct Material</name>
			<bg_color>#C0C0C0</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #7</supplier_name>
			<name>Direct Material</name>
			<bg_color>rgb(255,190,160)</bg_color>
			<width>50pt</width>
		</supplier>
		<supplier>
			<supplier_name>COMPANY #8</supplier_name>
			<name>Direct Material</name>
			<bg_color>#C0C0C0</bg_color>
			<width>50pt</width>
		</supplier>
	</header>
	
	<business_units>
		<bu>
			<bu_bg_color>rgb(255,190,160)</bu_bg_color>
			<bu_color>maroon</bu_color>
			<bu_title>CORPORATE</bu_title>
			<fullwidth>700pt</fullwidth>
			<bu_col_width><value>120pt</value></bu_col_width>
			<bu_col_width><value>60pt</value></bu_col_width>
			<bu_col_width><value>60pt</value></bu_col_width>
			<bu_col_width><value>30pt</value></bu_col_width>
			<bu_col_width><value>30pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<bu_col_width><value>50pt</value></bu_col_width>
			<sum_col_width><value>300pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<sum_col_width><value>50pt</value></sum_col_width>
			<bu_summary>
				<summary_item>
					<value>TOTAL COMPLIANCE FOR CORPORATE</value>
					<align>start</align><fontweight>normal</fontweight><color>#000000</color>
				</summary_item>
				<summary_item><value>76.24%</value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value></value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value></value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value>0.00%</value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value>100.00%</value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value></value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value></value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
				<summary_item><value></value><align>center</align><fontweight>bold</fontweight><color>#000000</color></summary_item>
			</bu_summary>
			<bu_line>
				<bu_item>
					<value>  Admin - Corporate</value>
					<align>start</align>
					<fontweight>normal</fontweight>
					<fontsize>6pt</fontsize>
				</bu_item>
				<bu_item>
					<value>George Smith</value>
					<align>start</align>
					<fontweight>normal</fontweight>
					<fontsize>6pt</fontsize>
				</bu_item>
				<bu_item>
					<value> </value>
					<align>start</align>
					<fontweight>normal</fontweight>
					<fontsize>6pt</fontsize>
				</bu_item>
				<bu_item>
					<value>100</value><align>start</align><fontweight>normal</fontweight><fontsize>6pt</fontsize>
				</bu_item>
				<bu_item><value>11111</value><align>start</align><fontweight>normal</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value>0.00%</value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value>0.00%</value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>				
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>
				<bu_item><value> </value><align>center</align><fontweight>bold</fontweight><fontsize>6pt</fontsize></bu_item>				
			</bu_line>
		</bu>
	</business_units>
</print-compliance>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
                              xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xsl:template match="print-compliance">
  <xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
    <fo:layout-master-set>
      <fo:simple-page-master master-name="compliance-form"
         margin-top="50pt"
         margin-bottom="50pt"
         margin-left="15pt"
         margin-right="20pt"
         page-height="8.5in"   
         page-width="11in">
        <fo:region-body margin-bottom="1pt"/>
      </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="compliance-form">
      <fo:flow flow-name="xsl-region-body">
        <xsl:apply-templates select="header" />
        <xsl:apply-templates select="business_units" />
      </fo:flow>
    </fo:page-sequence>
  </fo:root>
</xsl:template>
<xsl:template match="header">
  <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" border-style="none">
    <xsl:variable name="report_name" select="report_name" />
    <xsl:variable name="product_list" select="product_list" />
    <xsl:variable name="colors" select="grey" />
    <xsl:variable name="num_suppliers" select="suppliers" />
    <xsl:variable name="fullwidth" select="fullwidth" />
    <fo:table-column column-width="{$fullwidth}"/>
    <fo:table-body >
    	<fo:table-row>
        <fo:table-cell background-color="#C0C0C0" >
          <fo:block text-align="center" wrap-option="no-wrap" font-size="8pt" line-height="15pt"
                        font-weight="bold" color="maroon">
            <xsl:value-of select="report_name"/>
          </fo:block>
        </fo:table-cell>
      </fo:table-row>
    </fo:table-body>
  </fo:table>
  <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt"   border-style="solid"
         border-width="1pt">
    <fo:table-column column-width="300pt"/>
    <xsl:for-each select="supplier">
			<xsl:variable name="width" select="width" />
			<fo:table-column column-width="{$width}"/>
    </xsl:for-each>
		<fo:table-body >
     	<fo:table-row>
        <fo:table-cell border="solid 2pt">
          <fo:block text-align="end" wrap-option="no-wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold" color="#000000" background-color='#C0C0C0'>
            <xsl:text>COMMODITY  </xsl:text>
          </fo:block>
        </fo:table-cell>
        <xsl:for-each select="supplier">
          <fo:table-cell border ="solid 2pt">
    				<xsl:variable name="bg_color" select="bg_color" />
            <fo:block text-align="center" wrap-option="no-wrap" font-size="5pt" line-height="8pt" 
                  font-weight="bold" color="#000000" background-color='{$bg_color}'>
              <xsl:value-of select="name"/>
            </fo:block>
          </fo:table-cell>
        </xsl:for-each>
      </fo:table-row>
    </fo:table-body>
  </fo:table>
  <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt"   
  							border="solid 1pt">
    <fo:table-column column-width="120pt"/>
    <fo:table-column column-width="60pt"/>
    <fo:table-column column-width="60pt"/>
    <fo:table-column column-width="30pt"/>
    <fo:table-column column-width="30pt"/>
    <xsl:for-each select="supplier">
			<xsl:variable name="width" select="width" />
			<fo:table-column column-width="{$width}"/>
    </xsl:for-each>
		<fo:table-body >
     	<fo:table-row  background-color='#C0C0C0' display-align="after">
        <fo:table-cell border="solid .5pt">
          <fo:block text-align="start" wrap-option="no-wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold"  color="#000000" >
            <xsl:text>LOCATION</xsl:text>
          </fo:block>
        </fo:table-cell>
        <fo:table-cell border="solid .5pt">
          <fo:block text-align="start" wrap-option="no-wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold" color="#000000">
            <xsl:text>RESPONSIBILITY</xsl:text>
          </fo:block>
        </fo:table-cell>
        <fo:table-cell border="solid .5pt">
          <fo:block text-align="start" wrap-option="no-wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold" color="#000000">
            <xsl:text>VICE PRESIDENT</xsl:text>
          </fo:block>
        </fo:table-cell>
        <fo:table-cell border="solid .5pt">
          <fo:block text-align="center" wrap-option="wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold" color="#000000">
            <xsl:text>LOG/ FIN CO.</xsl:text>
          </fo:block>
        </fo:table-cell>
        <fo:table-cell border="solid .5pt">
          <fo:block text-align="center" wrap-option="wrap" font-size="6pt" line-height="8pt" 
                font-weight="bold"  color="#000000">
            <xsl:text>DIM.</xsl:text>
          </fo:block>
        </fo:table-cell>
        <xsl:for-each select="supplier">
    			<xsl:variable name="bg_color" select="bg_color" />
          <fo:table-cell border="solid .5pt" background-color='{$bg_color}'>
            <fo:block text-align="center" wrap-option="wrap" font-size="6pt" line-height="8pt" 
                 font-weight="bold" color="#000000">
              <xsl:value-of select="supplier_name"/>
              <xsl:text> PERCENT OF COMPLIANCE</xsl:text>
            </fo:block>
          </fo:table-cell>
        </xsl:for-each>
      </fo:table-row>
    </fo:table-body>
  </fo:table>
</xsl:template>

<xsl:template match="business_units">
  <xsl:for-each select="bu">
    <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
    										space-after="0pt" border-style=".5pt solid">
      <xsl:variable name="fullwidth" select="fullwidth" />
      <fo:table-column column-width='{$fullwidth}'/>
      <fo:table-body >
        <fo:table-row>
          <xsl:variable name="bu_bg_color" select="bu_bg_color" />
          <xsl:variable name="bu_color" select="bu_color" />
        	<fo:table-cell background-color='{$bu_bg_color}' border="solid 2pt">
            <fo:block text-align="start" wrap-option="no-wrap" font-size="8pt" line-height="15pt"
                          font-weight="bold" color='{$bu_color}'>
              <xsl:value-of select="bu_title"/>
            </fo:block>
          </fo:table-cell>
        </fo:table-row>
			</fo:table-body>
    </fo:table>        

    <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
                    space-after="0pt" border-style=".5pt solid" background-color='#FFFFFF' line-height="8pt" >
      <xsl:for-each select="bu_col_width">
        <xsl:variable name="width" select="value" />
        <fo:table-column column-width="{$width}"/>
      </xsl:for-each>
      <fo:table-body>
        <xsl:for-each select="bu_line">
          <fo:table-row>
            <xsl:for-each select="bu_item">
              <xsl:variable name="align" select="align" />
              <xsl:variable name="fontweight" select="fontweight" />
              <xsl:variable name="fontsize" select="fontsize" />
              <fo:table-cell border="solid .5pt" text-align="{$align}" font-weight="{$fontweight}" font-size="{$fontsize}">
                <xsl:value-of select="value"/>    	
              </fo:table-cell>
            </xsl:for-each>
          </fo:table-row>
        </xsl:for-each>
      </fo:table-body>
    </fo:table>

    <fo:table table-layout="fixed" border-collapse="collapse" space-before="0pt" 
    										space-after="0pt" border-style=".5pt solid" line-height="8pt" >
      <xsl:variable name="fullwidth" select="fullwidth" />
      <xsl:variable name="bu_bg_color" select="bu_bg_color" />
      <xsl:variable name="bu_color" select="bu_color" />
      <xsl:for-each select="sum_col_width">
        <xsl:variable name="width" select="value" />
        <fo:table-column column-width="{$width}"/>
      </xsl:for-each>
      <fo:table-body >
        <fo:table-row>
          <xsl:for-each select="summary_item">
            <xsl:variable name="align" select="align" />
            <xsl:variable name="fontweight" select="fontweight" />
            <fo:table-cell background-color='{$bu_bg_color}' border="solid 2pt" text-align="{$align}" 
                            font-weight="{$fontweight}" font-size="8pt"  line-height="15pt" color="{$bu_color}">
              <xsl:value-of select="value"/>    	
            </fo:table-cell>
          </xsl:for-each>
        </fo:table-row>
			</fo:table-body>
    </fo:table>        
  </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

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

Reply via email to