Solved

Help with XSL

Posted on 2004-04-15
8
497 Views
Last Modified: 2008-03-17
I designed a XSL style sheet using  Scriptura. I need to embed some XSL code

to get the multiple rows in the ouput table(PDF).

The following is my XSL file:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet extension-element-prefixes=" idprint scriptura_dataformatter java" version="1.0" xml:space="preserve" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:idprint="http://uris.inventivedesigners.com/xsl-fo/ext/print-settings" xmlns:java="http://xml.apache.org/xalan/java" xmlns:scriptura_dataformatter="com.id.dataformatting.xalan.DataFormatter" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:param name="com.id.scriptura.extvar.scriptura.doc.lang">DEFAULT</xsl:param>
      <xsl:variable name="com.id.scriptura.language" select="$com.id.scriptura.extvar.scriptura.doc.lang"/>
      <xsl:variable name="com.id.scriptura.languagenumberformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">(|)|||.|,|3|1|0|3|¤|-</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:variable name="com.id.scriptura.languagecurrencyformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">(¤ |)|¤ ||.|,|0|1|0|0|¤|-</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:variable name="com.id.scriptura.languagedateformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">yyyy/MM/dd</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:template match="/">
            <xsl:comment>This document was automatically generated by Scriptura from Inventive Designers nv. For more information refer to http://www.inventivedesigners.com/. Editing this document by hand is not supported by Scriptura and is at your own risk.</xsl:comment>
            <fo:root linefeed-treatment="preserve">
                  <fo:layout-master-set>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_first" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_first_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_first_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_first_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_first_reg-end"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_last" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_last_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_last_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_last_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_last_reg-end"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_any" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_any_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_any_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_any_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_any_reg-end"/>
                        </fo:simple-page-master>
                        <fo:page-sequence-master master-name="page-seq0">
                              <fo:repeatable-page-master-alternatives>
                                    <fo:conditional-page-master-reference master-reference="page0_first" page-position="first"/>
                                    <fo:conditional-page-master-reference master-reference="page0_last" page-position="last"/>
                                    <fo:conditional-page-master-reference master-reference="page0_any" page-position="any"/>
                              </fo:repeatable-page-master-alternatives>
                        </fo:page-sequence-master>
                  </fo:layout-master-set>
                  <fo:page-sequence force-page-count="auto" format="1" initial-page-number="auto" master-reference="page-seq0">
                        <fo:static-content flow-name="page0_first_reg-start"/>
                        <fo:static-content flow-name="page0_last_reg-start"/>
                        <fo:static-content flow-name="page0_any_reg-start"/>
                        <fo:static-content flow-name="page0_first_reg-end"/>
                        <fo:static-content flow-name="page0_last_reg-end"/>
                        <fo:static-content flow-name="page0_any_reg-end"/>
                        <fo:static-content flow-name="page0_first_reg-before"/>
                        <fo:static-content flow-name="page0_last_reg-before"/>
                        <fo:static-content flow-name="page0_any_reg-before"/>
                        <fo:static-content flow-name="page0_first_reg-after"/>
                        <fo:static-content flow-name="page0_last_reg-after"/>
                        <fo:static-content flow-name="page0_any_reg-after"/>
                        <fo:flow flow-name="reg-body">
                              <fo:block-container height="50pt" left="0pt" position="absolute" top="0pt" width="100%">
                                    <fo:block>
                                          <fo:inline color="#aa0030" font-family="Arial" font-size="8.0pt">This document was created using a trial version of Scriptura. For more information see http://www.inventivedesigners.com</fo:inline>
                                    </fo:block>
                              </fo:block-container>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="328.3pt" margin-right="30.55pt" space-before="33.3pt" table-layout="fixed" alignment-adjust="right">
                                    <fo:table-column column-width="53.0pt"/>
                                    <fo:table-column column-width="70.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="21.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">INVOICE #</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="21.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="59.3pt" margin-right="251.55pt" space-before="23.0pt" table-layout="fixed">
                                    <fo:table-column column-width="171.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="29.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <xsl:attribute name="padding">0.0pt 0.0pt 17.0pt 0.0pt</xsl:attribute>
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">BILL TO</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="29.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="293.3pt" margin-right="31.55pt" space-before="0.0pt" table-layout="fixed">
                                    <fo:table-column column-width="157.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="27.5pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP TO</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="29.5pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="58.3pt" margin-right="29.55pt" space-before="10.0pt" table-layout="fixed">
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="15.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">PO NBR</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP VIA</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">FOB</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DUE DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="15.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="62.3pt" margin-right="30.35pt" space-before="23.0pt" table-layout="fixed">
                                    <fo:table-column column-width="57.2pt"/>
                                    <fo:table-column column-width="63.2pt"/>
                                    <fo:table-column column-width="53.2pt"/>
                                    <fo:table-column column-width="75.2pt"/>
                                    <fo:table-column column-width="95.2pt"/>
                                    <fo:table-column column-width="45.2pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="20.1pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="center">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">QUANTITY</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DESCRIPTION</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">UOM</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">UNIT PRICE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">AMOUNT</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                          <fo:table-row height="76.15pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000"  border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">
                                                                        <xsl:value-of select="/month/invoice/projects/project/quantity"/>
                                                                  </fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">
                                                                        <xsl:value-of select="/month/invoice/projects/project[position()=2]/description"/>
                                                                  </fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                          <fo:table-row height="19.75pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" number-columns-spanned="3"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                          <fo:table-row height="19.75pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" number-columns-spanned="3">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt"  margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">                  Total Invoice Amount</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              
                        </fo:flow>
                  </fo:page-sequence>
            </fo:root>
      </xsl:template>
</xsl:stylesheet>


The following is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<month name="February">
      <invoice date="31 April, 2003" number="23453234">
            <billto>
                  <line1>John Brown</line1>
                  <line2>1234 AVENUE A</line2>
                  <line3>BROOKHAVEN, GA 12344</line3>
                  <!-- More line nodes can be added as required -->
            </billto>
            <shipto>
                  <line1>SUDHEER BASU</line1>
                  <line2>1234 AVENUE A</line2>
                  <line3>BROOKHAVEN, GA 12344</line3>
                  <!-- More line nodes can be added as required -->
            </shipto>
            <firsttable>
                  <rowd>
                        <ponbr>ABC123</ponbr>
                        <shipdate>08/12/03</shipdate>
                        <shipvia>GROUND</shipvia>
                        <fob>DESTINATION</fob>
                        <duedate>09/12/03</duedate>
                  </rowd>
            </firsttable>
            <projects>
                  <project>
                        <quantity>11</quantity>
                        <description>Materials</description>
                        <uom>70</uom>
                        <unitprice>10</unitprice>
                        <amount>12</amount>
                        <flag>T</flag>
                  </project>
                  <project>
                        <quantity>22</quantity>
                        <description>Construction</description>
                        <uom>70</uom>
                        <unitprice>10</unitprice>
                        <amount>12</amount>
                        <flag>T</flag>
                  </project>
                  <project>
                        <quantity>33</quantity>
                        <description>Vehicle</description>
                        <uom>70</uom>
                        <unitprice>10</unitprice>
                        <amount>12</amount>
                        <flag>T</flag>
                  </project>
                  <!-- More project nodes can be added as required -->
            </projects>
      </invoice>
</month>


I need to get multiple project records in the output table. As I am new to XSL I dont know
how to use foreach and select to get multiple records into the table. Right now it fetches only first
record into the table. Your help is appreciated.

Thank you in advance,
Sudheer.

0
Comment
Question by:siru2803
  • 4
  • 3
8 Comments
 
LVL 15

Expert Comment

by:dualsoul
ID: 10836375
don't you want to post your XML here? so we can see data you want to build invoice for :)
0
 
LVL 15

Expert Comment

by:dualsoul
ID: 10840064
ohhh...sorry i see xml now....something wrong with my head yesterday evening ;)
i'll take a look at your xsl a bit later.
0
 
LVL 15

Accepted Solution

by:
dualsoul earned 500 total points
ID: 10840371
try this one, does it suites you?
.............................................................................
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet extension-element-prefixes=" idprint scriptura_dataformatter java" version="1.0" xml:space="preserve" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:idprint="http://uris.inventivedesigners.com/xsl-fo/ext/print-settings" xmlns:java="http://xml.apache.org/xalan/java" xmlns:scriptura_dataformatter="com.id.dataformatting.xalan.DataFormatter" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:param name="com.id.scriptura.extvar.scriptura.doc.lang">DEFAULT</xsl:param>
      <xsl:variable name="com.id.scriptura.language" select="$com.id.scriptura.extvar.scriptura.doc.lang"/>
      <xsl:variable name="com.id.scriptura.languagenumberformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">(|)|||.|,|3|1|0|3|¤|-</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:variable name="com.id.scriptura.languagecurrencyformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">(¤ |)|¤ ||.|,|0|1|0|0|¤|-</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:variable name="com.id.scriptura.languagedateformatter">
            <xsl:choose>
                  <xsl:when test="$com.id.scriptura.language='DEFAULT'">yyyy/MM/dd</xsl:when>
            </xsl:choose>
      </xsl:variable>
      <xsl:template match="/">
            <xsl:comment>This document was automatically generated by Scriptura from Inventive Designers nv. For more information refer to http://www.inventivedesigners.com/. Editing this document by hand is not supported by Scriptura and is at your own risk.</xsl:comment>
            <fo:root linefeed-treatment="preserve">
                  <fo:layout-master-set>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_first" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_first_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_first_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_first_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_first_reg-end"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_last" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_last_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_last_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_last_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_last_reg-end"/>
                        </fo:simple-page-master>
                        <fo:simple-page-master idprint:input-tray="0" idprint:output-tray="0" master-name="page0_any" page-height="841.85pt" page-width="595.25pt">
                              <fo:region-body margin-bottom="56.7pt" margin-left="56.7pt" margin-right="56.7pt" margin-top="56.7pt" region-name="reg-body"/>
                              <fo:region-before extent="56.7pt" precedence="true" region-name="page0_any_reg-before"/>
                              <fo:region-after extent="56.7pt" precedence="true" region-name="page0_any_reg-after"/>
                              <fo:region-start extent="56.7pt" region-name="page0_any_reg-start"/>
                              <fo:region-end extent="56.7pt" region-name="page0_any_reg-end"/>
                        </fo:simple-page-master>
                        <fo:page-sequence-master master-name="page-seq0">
                              <fo:repeatable-page-master-alternatives>
                                    <fo:conditional-page-master-reference master-reference="page0_first" page-position="first"/>
                                    <fo:conditional-page-master-reference master-reference="page0_last" page-position="last"/>
                                    <fo:conditional-page-master-reference master-reference="page0_any" page-position="any"/>
                              </fo:repeatable-page-master-alternatives>
                        </fo:page-sequence-master>
                  </fo:layout-master-set>
                  <fo:page-sequence force-page-count="auto" format="1" initial-page-number="auto" master-reference="page-seq0">
                        <fo:static-content flow-name="page0_first_reg-start"/>
                        <fo:static-content flow-name="page0_last_reg-start"/>
                        <fo:static-content flow-name="page0_any_reg-start"/>
                        <fo:static-content flow-name="page0_first_reg-end"/>
                        <fo:static-content flow-name="page0_last_reg-end"/>
                        <fo:static-content flow-name="page0_any_reg-end"/>
                        <fo:static-content flow-name="page0_first_reg-before"/>
                        <fo:static-content flow-name="page0_last_reg-before"/>
                        <fo:static-content flow-name="page0_any_reg-before"/>
                        <fo:static-content flow-name="page0_first_reg-after"/>
                        <fo:static-content flow-name="page0_last_reg-after"/>
                        <fo:static-content flow-name="page0_any_reg-after"/>
                        <fo:flow flow-name="reg-body">
                              <fo:block-container height="50pt" left="0pt" position="absolute" top="0pt" width="100%">
                                    <fo:block>
                                          <fo:inline color="#aa0030" font-family="Arial" font-size="8.0pt">This document was created using a trial version of Scriptura. For more information see http://www.inventivedesigners.com</fo:inline>
                                    </fo:block>
                              </fo:block-container>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="328.3pt" margin-right="30.55pt" space-before="33.3pt" table-layout="fixed" alignment-adjust="right">
                                    <fo:table-column column-width="53.0pt"/>
                                    <fo:table-column column-width="70.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="21.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">INVOICE #</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="21.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="59.3pt" margin-right="251.55pt" space-before="23.0pt" table-layout="fixed">
                                    <fo:table-column column-width="171.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="29.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <xsl:attribute name="padding">0.0pt 0.0pt 17.0pt 0.0pt</xsl:attribute>
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">BILL TO</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="29.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="293.3pt" margin-right="31.55pt" space-before="0.0pt" table-layout="fixed">
                                    <fo:table-column column-width="157.0pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="27.5pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP TO</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="29.5pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="58.3pt" margin-right="29.55pt" space-before="10.0pt" table-layout="fixed">
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-column column-width="78.8pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="15.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">PO NBR</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">SHIP VIA</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">FOB</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DUE DATE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                          </fo:table-row>
                                          <fo:table-row height="15.0pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                              <fo:table border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" margin-left="62.3pt" margin-right="30.35pt" space-before="23.0pt" table-layout="fixed">
                                    <fo:table-column column-width="57.2pt"/>
                                    <fo:table-column column-width="63.2pt"/>
                                    <fo:table-column column-width="53.2pt"/>
                                    <fo:table-column column-width="75.2pt"/>
                                    <fo:table-column column-width="95.2pt"/>
                                    <fo:table-column column-width="45.2pt"/>
                                    <fo:table-body>
                                          <fo:table-row height="20.1pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="center">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">QUANTITY</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">DESCRIPTION</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">UOM</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">UNIT PRICE</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">AMOUNT</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                          <!-- CHAGES FROM HERE -->
                                          <xsl:for-each select="/month/invoice/projects/project">
                                                <fo:table-row height="76.15pt">
                                                      <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                      <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                      <xsl:attribute name="keep-together">always</xsl:attribute>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                            <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                                  <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                                  <fo:block font-size="9.0pt" text-align="left">
                                                                        <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">
                                                                              <xsl:value-of select="quantity"/>
                                                                        </fo:inline>
                                                                  </fo:block>
                                                            </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt">
                                                            <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                                  <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                                  <fo:block font-size="9.0pt" text-align="left">
                                                                        <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">
                                                                              <xsl:value-of select="description"/>
                                                                        </fo:inline>
                                                                  </fo:block>
                                                            </fo:block>
                                                      </fo:table-cell>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                      <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                </fo:table-row>
                                          </xsl:for-each>
                                          <!-- TO HERE -->
                                          <fo:table-row height="19.75pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" number-columns-spanned="3"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                          <fo:table-row height="19.75pt">
                                                <xsl:attribute name="keep-with-next">auto</xsl:attribute>
                                                <xsl:attribute name="keep-with-previous">auto</xsl:attribute>
                                                <xsl:attribute name="keep-together">always</xsl:attribute>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt" number-columns-spanned="3">
                                                      <fo:block border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.0pt 0.0pt 0.0pt 0.0pt" margin-left="0.0pt" margin-right="0.0pt" space-before="0.0pt">
                                                            <xsl:attribute name="padding">2.0pt 2.0pt 0.0pt 2.0pt</xsl:attribute>
                                                            <fo:block font-size="9.0pt" text-align="left">
                                                                  <fo:inline color="#000000" font-family="Times New Roman" font-size="9.0pt" font-style="normal" font-weight="normal" text-decoration=" no-line-through no-underline" white-space-collapse="false">                  Total Invoice Amount</fo:inline>
                                                            </fo:block>
                                                      </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                                <fo:table-cell border-color="#000000 #000000 #000000 #000000" border-style="solid solid solid solid" border-width="0.1pt 0.1pt 0.1pt 0.1pt"/>
                                          </fo:table-row>
                                    </fo:table-body>
                              </fo:table>
                        </fo:flow>
                  </fo:page-sequence>
            </fo:root>
      </xsl:template>
</xsl:stylesheet>
.............................................................................
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Expert Comment

by:ljfernandez
ID: 10844801
I think what you want is something like this, it's a simpler xsl, maybe it will help you:

<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method="html" indent="no" media-type="text/html" encoding="iso-8859-1" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>

<xsl:template match="/">

      <div class="contentHead">
            <div id="contentTitle" class="contentTitle txtTitle">
                  For month of: <xsl:value-of select="month/@name"/><br/><br/>
            </div>
      </div>
      
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr>
            <td>Invoice #:</td>
            <td><xsl:value-of select="month/invoice/@date"/></td>
            <td>Invoice Date:</td>
            <td><xsl:value-of select="month/invoice/@number"/></td>
             </tr>
      </table>

      <br/><br/>
      
      <table width="100%">
      <tr>
      <td>Bill To:</td><td>Ship To:</td> <td>Shipping Info</td>
      
      </tr><tr>
      <td valign="top">
            <xsl:value-of select="month/invoice/billto/line1"/><br/>
            <xsl:value-of select="month/invoice/billto/line2"/><br/>
            <xsl:value-of select="month/invoice/billto/line3"/>
      </td>
      
      <td valign="top">
            <xsl:value-of select="month/invoice/shipto/line1"/><br/>
            <xsl:value-of select="month/invoice/shipto/line2"/><br/>
            <xsl:value-of select="month/invoice/shipto/line3"/>
      </td>
      
      <td valign="top">
            <xsl:value-of select="month/invoice/firsttable/rowd/ponbr"/><br/>
            <xsl:value-of select="month/invoice/firsttable/rowd/shipdate"/><br/>
            <xsl:value-of select="month/invoice/firsttable/rowd/shipvia"/><br/>
            <xsl:value-of select="month/invoice/firsttable/rowd/fob"/><br/>
            <xsl:value-of select="month/invoice/firsttable/rowd/duedate"/>
      </td>
      </tr>
      </table>
      
      <br/><br/>


      <table width="100%">
            <tr>
                  <td align="center">Quantity</td>
                  <td>Description</td>
                  <td align="center">UOM</td>
                  <td align="center">Unit</td>
                  <td align="center">Price</td>
                  <td align="center">Amount</td>
                  
            </tr>
            
            <xsl:for-each select="month/invoice/projects/project">
                  
            <tr>
                  <td align="center"><xsl:value-of select="quantity"/></td>
                  <td><xsl:value-of select="description"/></td>
                  <td align="center"><xsl:value-of select="uom"/></td>
                  <td align="center"><xsl:value-of select="flag"/></td>
                  <td align="center"><xsl:value-of select="unitprice"/></td>
                  <td align="center"><xsl:value-of select="amount"/></td>
                  
            </tr>
            
            </xsl:for-each>

      
      </table>
</xsl:template>

</xsl:stylesheet>
0
 
LVL 3

Expert Comment

by:ljfernandez
ID: 10844869
I noticed that the invoice number and date were in the wrong positions. Substitute this code for that table:

      <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr>
            <td>Invoice #:</td>
            <td><xsl:value-of select="month/invoice/@number"/></td>
            <td>Invoice Date:</td>
            <td><xsl:value-of select="month/invoice/@date"/></td>
             </tr>
      </table>


--Lisa
0
 
LVL 15

Expert Comment

by:dualsoul
ID: 10845193
ljfernandez don't you think we are talking about XSL:FO, not html ? :)
0
 
LVL 3

Expert Comment

by:ljfernandez
ID: 10845251
Sorry about that. I have not used it before, so I guess I just didn't know what I was looking at.
--Lisa
0
 

Expert Comment

by:NickHofstede
ID: 11013689
If you make the row of the table containing the datafields a "Detail Row" (select the row and click on the Group Type attribute under Data) you can make it repeat over all project elements. Re-add your datafields (to make them relative to the current project element), and the generated xslt should contain an xsl:for-each and work without modifications.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
character entities and entity references in XML 17 121
Change to event 1 111
Create html table using xsl 8 36
MS Access XML API HTTP POST Call Object Send Not Working Correctly 15 50
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now