Grouping by column row values in xsl:fo table - xslt

I am trying to group values of individual column in xsl fo:table, some values not grouped as expected, it get grouped according to previous column's grouped value,
i need individual grouping in columns, check with my xsl and xml file, i am using these files to generate PDF file using apache FOP.
My XSL File
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="data">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple"
page-height="8.5in" page-width="11in" margin-top=".5in"
margin-bottom=".5in" margin-left=".5in" margin-right=".5in">
<fo:region-body margin-top="2cm" margin-bottom="2cm" />
<fo:region-before extent="2cm" overflow="hidden" />
<fo:region-after extent="1cm" overflow="hidden" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple"
initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="13.0pt" font-family="serif"
padding-after="2.0pt" space-before="4.0pt" text-align="center"
border-bottom-style="solid" border-bottom-width="1.0pt">
<xsl:text>PDF Test</xsl:text>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="12.0pt" font-family="sans-serif"
padding-after="2.0pt" space-before="2.0pt" text-align="center"
border-top-style="solid" border-bottom-width="1.0pt">
<xsl:text>Page</xsl:text>
<fo:page-number />
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="data-body" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="data-body">
<fo:block text-align="center">
<fo:table table-layout="fixed" width="100%"
border-style="dashed">
<fo:table-column border-style="solid" />
<fo:table-column border-style="solid" />
<fo:table-column border-style="solid" />
<fo:table-header>
<xsl:apply-templates select="table-header" />
</fo:table-header>
<fo:table-body>
<xsl:for-each-group select="table-data" group-adjacent="column-two">
<xsl:apply-templates select="current-group()">
<xsl:with-param name="row-span" select="count(current-group())" tunnel="yes"/>
</xsl:apply-templates>
</xsl:for-each-group>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<xsl:template match="table-header">
<fo:table-row keep-together.within-page="always"
border-style="solid">
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-one"></xsl:value-of>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-two"></xsl:value-of>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-three"></xsl:value-of>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="table-data">
<fo:table-row keep-together.within-page="always"
border-style="solid">
<xsl:apply-templates>
<xsl:with-param name="row-group-index" tunnel="yes" select="position()"/>
</xsl:apply-templates>
</fo:table-row>
</xsl:template>
<xsl:template match="table-data/*">
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="."></xsl:value-of>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="table-data/column-two">
<xsl:param name="row-span" tunnel="yes"/>
<xsl:param name="row-group-index" tunnel="yes"/>
<xsl:choose>
<xsl:when test="$row-span = 1">
<xsl:next-match/>
</xsl:when>
<xsl:when test="$row-span > 1 and $row-group-index = 1">
<fo:table-cell number-rows-spanned="{$row-span}">
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="."></xsl:value-of>
</fo:block>
</fo:table-cell>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="table-data/column-three">
<xsl:param name="row-span" tunnel="yes"/>
<xsl:param name="row-group-index" tunnel="yes"/>
<xsl:choose>
<xsl:when test="$row-span = 1">
<xsl:next-match/>
</xsl:when>
<xsl:when test="$row-span > 1 and $row-group-index = 1">
<fo:table-cell number-rows-spanned="{$row-span}">
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="."></xsl:value-of>
</fo:block>
</fo:table-cell>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
My XML File
<?xml version="1.0" encoding="UTF-8"?>
<data>
<data-body>
<table-header>
<column-one>Column One</column-one>
<column-two>Column Two</column-two>
<column-three>Column Three</column-three>
</table-header>
<table-data>
<column-one>One</column-one>
<column-two>5000</column-two>
<column-three>Three</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>5000</column-two>
<column-three>Three</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>1200</column-two>
<column-three>Three</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>2000</column-two>
<column-three>Four</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>2000</column-two>
<column-three>Four</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>1234</column-two>
<column-three>Five</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>5666</column-two>
<column-three>Five</column-three>
</table-data>
<table-data>
<column-one>One</column-one>
<column-two>5666</column-two>
<column-three>Five</column-three>
</table-data>
</data-body>
</data>

I think one way to solve that is to use two passes, one which computes and adds the row-span to columns, and the second that transforms to XSL-FO.
In https://xsltfiddle.liberty-development.net/3NSSEuY/2 I have used XSLT 3 and xsl:iterate to implement the first step for a sequence of column names provided as an xs:string* parameter:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="#all"
version="3.0">
<xsl:param name="columns-to-group" as="xs:string*" select="'column-two', 'column-three'"/>
<xsl:mode name="compute-row-spans" on-no-match="shallow-copy"/>
<xsl:mode name="compute-row-span" on-no-match="shallow-copy"/>
<xsl:template match="data-body" mode="compute-row-spans">
<xsl:iterate select="$columns-to-group">
<xsl:param name="table" select="."/>
<xsl:on-completion select="$table"/>
<xsl:next-iteration>
<xsl:with-param name="table">
<xsl:apply-templates select="$table" mode="compute-row-span">
<xsl:with-param name="column-to-group" tunnel="yes" select="."/>
</xsl:apply-templates>
</xsl:with-param>
</xsl:next-iteration>
</xsl:iterate>
</xsl:template>
<xsl:template match="data-body" mode="compute-row-span">
<xsl:param name="column-to-group" as="xs:string" tunnel="yes"/>
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="table-header"/>
<xsl:for-each-group select="table-data" group-adjacent="*[name() = $column-to-group]">
<xsl:apply-templates select="current-group()" mode="compute-row-span">
<xsl:with-param name="column-to-group" tunnel="yes" select="$column-to-group"/>
<xsl:with-param name="row-span" select="count(current-group())" tunnel="yes"/>
</xsl:apply-templates>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
<xsl:template match="table-data" mode="compute-row-span">
<xsl:copy>
<xsl:apply-templates select="#*" mode="#current"/>
<xsl:apply-templates select="*" mode="#current">
<xsl:with-param name="current-row-index" tunnel="yes" select="position()"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="table-data/*" mode="compute-row-span">
<xsl:param name="column-to-group" tunnel="yes"/>
<xsl:param name="row-span" tunnel="yes"/>
<xsl:param name="current-row-index" tunnel="yes"/>
<xsl:choose>
<xsl:when test="name() = $column-to-group and $row-span > 1">
<xsl:if test="$current-row-index = 1">
<xsl:copy>
<xsl:apply-templates select="#*" mode="#current"/>
<xsl:attribute name="row-span" select="$row-span"/>
<xsl:apply-templates mode="#current"/>
</xsl:copy>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:next-match/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="data">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple"
page-height="8.5in" page-width="11in" margin-top=".5in"
margin-bottom=".5in" margin-left=".5in" margin-right=".5in">
<fo:region-body margin-top="2cm" margin-bottom="2cm" />
<fo:region-before extent="2cm" overflow="hidden" />
<fo:region-after extent="1cm" overflow="hidden" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple"
initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="13.0pt" font-family="serif"
padding-after="2.0pt" space-before="4.0pt" text-align="center"
border-bottom-style="solid" border-bottom-width="1.0pt">
<xsl:text>PDF Test</xsl:text>
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="12.0pt" font-family="sans-serif"
padding-after="2.0pt" space-before="2.0pt" text-align="center"
border-top-style="solid" border-bottom-width="1.0pt">
<xsl:text>Page</xsl:text>
<fo:page-number />
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="data-body" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="data-body">
<fo:block text-align="center">
<fo:table table-layout="fixed" width="100%"
border-style="dashed">
<fo:table-column border-style="solid" />
<fo:table-column border-style="solid" />
<fo:table-column border-style="solid" />
<fo:table-header>
<xsl:apply-templates select="table-header" />
</fo:table-header>
<xsl:variable name="table-with-row-spans">
<xsl:apply-templates select="." mode="compute-row-spans"/>
</xsl:variable>
<fo:table-body>
<xsl:apply-templates select="$table-with-row-spans/data-body/table-data"/>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<xsl:template match="table-header">
<fo:table-row keep-together.within-page="always"
border-style="solid">
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-one"></xsl:value-of>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-two"></xsl:value-of>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:value-of select="column-three"></xsl:value-of>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template match="table-data">
<fo:table-row keep-together.within-page="always"
border-style="solid">
<xsl:apply-templates/>
</fo:table-row>
</xsl:template>
<xsl:template match="table-data/*">
<fo:table-cell>
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
<xsl:template match="table-data/*[#row-span]">
<fo:table-cell number-rows-spanned="{#row-span}">
<fo:block font-size="10pt" font-family="sans-serif"
padding-top="3pt">
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
</xsl:template>
</xsl:stylesheet>

Related

PDF Alignment issues when upgrading from fop-0.95 to fop-2.3

I'm new to the XSLT FO world and came across an issue. I have my XSLT that works well with the fop-0.95 processor and generates the PDF, but after I upgraded to fop-2.3, it left my first page blank and started the PDF body from the second page (my PDF has a header that appears fine on the first page).
I figured out where the issue was, and it was because I had the margin-top value set to 3 inches in the "fo:region-body" tag within the "fo:layout-master-set" (please see screenshot). I had to change the margin-top from 3 inches to 2.5 inches for the body of my PDF to appear like it was while using fop-0.95.
<?xml version="1.0" encoding="UTF-8"?>
<!--Designed and generated by Altova StyleVision Enterprise Edition 2013 (x64) - see http://www.altova.com/stylevision for more information.-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:altova="http://www.altova.com" xmlns:altovaext="http://www.altova.com/xslt-extensions" xmlns:clitype="clitype" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:iso4217="http://www.xbrl.org/2003/iso4217" xmlns:ix="http://www.xbrl.org/2008/inlineXBRL" xmlns:java="java" xmlns:link="http://www.xbrl.org/2003/linkbase" xmlns:sps="http://www.altova.com/StyleVision/user-xpath-functions" xmlns:xbrldi="http://xbrl.org/2006/xbrldi" xmlns:xbrli="http://www.xbrl.org/2003/instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg" exclude-result-prefixes="altova altovaext clitype fn iso4217 ix java link sps xbrldi xbrli xlink xs xsi">
<xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
<xsl:param name="SV_OutputFormat" select="'PDF'"/>
<xsl:variable name="XML" select="/"/>
<xsl:variable name="fo:layout-master-set">
<fo:layout-master-set>
<fo:simple-page-master master-name="page-master-0-even" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.50in" margin-top="0.30in" margin-bottom="0.30in">
<fo:region-body margin-top="0.45in" margin-bottom="0.45in" column-count="1" column-gap="0.50in"/>
<fo:region-before region-name="even-page-header" overflow="hidden" extent="0.45in"/>
<fo:region-after region-name="even-page-footer" overflow="hidden" extent="0.45in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-master-0-odd" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.50in" margin-top="0.30in" margin-bottom="0.30in">
<fo:region-body margin-top="0.45in" margin-bottom="0.45in" column-count="1" column-gap="0.50in"/>
<fo:region-before region-name="odd-page-header" overflow="hidden" extent="0.45in"/>
<fo:region-after region-name="odd-page-footer" overflow="hidden" extent="0.45in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-master-0-even-first" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.50in" margin-top="0.30in" margin-bottom="0.30in">
<fo:region-body margin-top="3in" margin-bottom="0.45in" column-count="1" column-gap="0.50in"/>
<fo:region-before region-name="even-page-header-first" overflow="hidden" extent="3in"/>
<fo:region-after region-name="even-page-footer" overflow="hidden" extent="0.45in"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="page-master-0-odd-first" margin-left="0.50in" margin-right="0.50in" page-height="11in" page-width="8.50in" margin-top="0.30in" margin-bottom="0.30in">
<fo:region-body margin-top="3in" margin-bottom="0.45in" column-count="1" column-gap="0.50in"/>
<fo:region-before region-name="odd-page-header-first" overflow="hidden" extent="3in"/>
<fo:region-after region-name="odd-page-footer" overflow="hidden" extent="0.45in"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="page-master-0">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="page-master-0-even-first" odd-or-even="even" page-position="first"/>
<fo:conditional-page-master-reference master-reference="page-master-0-odd-first" odd-or-even="odd" page-position="first"/>
<fo:conditional-page-master-reference master-reference="page-master-0-even" odd-or-even="even"/>
<fo:conditional-page-master-reference master-reference="page-master-0-odd" odd-or-even="odd"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
</xsl:variable>
<xsl:variable name="altova:nPxPerIn" select="96"/>
<xsl:template match="/">
<fo:root>
<xsl:copy-of select="$fo:layout-master-set"/>
<fo:declarations>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>Altova StyleVision Enterprise Edition 2013 (x64) (http://www.altova.com)</xmp:CreatorTool>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
</fo:declarations>
<fo:page-sequence force-page-count="no-force" master-reference="page-master-0" initial-page-number="auto" format="1">
<fo:static-content flow-name="odd-page-header-first">
<fo:block-container overflow="hidden" display-align="before">
<fo:block>
<xsl:for-each select="$XML">
<xsl:for-each select="DOCUMENT">
<xsl:for-each select="DATA">
<xsl:for-each select="STRUCT">
<xsl:for-each select="FIELD[FNAME=&apos;nfHeaderDtls&apos;]">
<xsl:for-each select="STRUCT">
<fo:block-container font-family="Arial" font-size="10pt" width="7.490000in" height="3.000000in" overflow="hidden">
<fo:block-container absolute-position="absolute" font-family="Arial" font-size="9pt" height="1.21in" left="4.55in" top="1.75in" width="2.90in" overflow="hidden">
<fo:block>
<xsl:for-each select="FIELD[FNAME=&apos;Name&apos;]">
<xsl:for-each select="VALUE">
<xsl:variable name="value-of-template_1">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains(string($value-of-template_1),'​')">
<fo:block>
<xsl:copy-of select="$value-of-template_1"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline>
<xsl:copy-of select="$value-of-template_1"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
<fo:block/>
</fo:block>
</fo:block-container>
</fo:block-container>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:static-content flow-name="even-page-header-first">
<fo:block-container overflow="hidden" display-align="before">
<fo:block>
<xsl:for-each select="$XML">
<xsl:for-each select="DOCUMENT">
<xsl:for-each select="DATA">
<xsl:for-each select="STRUCT">
<xsl:for-each select="FIELD[FNAME=&apos;nfHeaderDtls&apos;]">
<xsl:for-each select="STRUCT">
<fo:block-container font-family="Arial" font-size="10pt" width="7.490000in" height="3.000000in" overflow="hidden">
<fo:block-container absolute-position="absolute" font-family="Arial" font-size="9pt" height="1.21in" left="4.55in" top="1.75in" width="2.90in" overflow="hidden">
<fo:block>
<xsl:for-each select="FIELD[FNAME=&apos;Name&apos;]">
<xsl:for-each select="VALUE">
<xsl:variable name="value-of-template_1">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains(string($value-of-template_1),'​')">
<fo:block>
<xsl:copy-of select="$value-of-template_1"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline>
<xsl:copy-of select="$value-of-template_1"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
<fo:block/>
</fo:block>
</fo:block-container>
</fo:block-container>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:static-content flow-name="odd-page-header">
<fo:block-container overflow="hidden" display-align="before">
<fo:block>
<xsl:for-each select="$XML">
<xsl:for-each select="DOCUMENT">
<xsl:for-each select="DATA">
<xsl:for-each select="STRUCT">
<xsl:for-each select="FIELD[FNAME=&apos;nfHeaderDtls&apos;]">
<xsl:for-each select="STRUCT">
<fo:block-container font-family="Arial" font-size="10pt" width="7.500000in" height="0.500000in" overflow="hidden">
<fo:block-container absolute-position="absolute" height="0.19in" left="0in" top="0in" width="2.78in" overflow="hidden">
<fo:block>
<fo:inline>
<xsl:text>Identifier: </xsl:text>
</fo:inline>
<xsl:for-each select="FIELD[FNAME=&apos;caseReference&apos;]">
<xsl:for-each select="VALUE">
<xsl:variable name="value-of-template_27">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains(string($value-of-template_27),'​')">
<fo:block>
<xsl:copy-of select="$value-of-template_27"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline>
<xsl:copy-of select="$value-of-template_27"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:block-container>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:static-content flow-name="even-page-header">
<fo:block-container overflow="hidden" display-align="before">
<fo:block>
<xsl:for-each select="$XML">
<xsl:for-each select="DOCUMENT">
<xsl:for-each select="DATA">
<xsl:for-each select="STRUCT">
<xsl:for-each select="FIELD[FNAME=&apos;nfHeaderDtls&apos;]">
<xsl:for-each select="STRUCT">
<fo:block-container font-family="Arial" font-size="10pt" width="7.500000in" height="0.500000in" overflow="hidden">
<fo:block-container absolute-position="absolute" height="0.19in" left="0in" top="0in" width="2.78in" overflow="hidden">
<fo:block>
<fo:inline>
<xsl:text>Identifier: </xsl:text>
</fo:inline>
<xsl:for-each select="FIELD[FNAME=&apos;caseReference&apos;]">
<xsl:for-each select="VALUE">
<xsl:variable name="value-of-template_27">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains(string($value-of-template_27),'​')">
<fo:block>
<xsl:copy-of select="$value-of-template_27"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline>
<xsl:copy-of select="$value-of-template_27"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:block-container>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:static-content flow-name="odd-page-footer">
<fo:block-container height="0.45in" overflow="hidden" display-align="after">
<fo:block>
<fo:block-container font-family="Arial" font-size="10pt" width="7.490000in" height="0.500000in" overflow="hidden">
<fo:block-container absolute-position="absolute" height="0.40in" left="0in" top="0in" width="4.04in" overflow="hidden">
<fo:block>
<fo:inline>
<xsl:text>My Test Form</xsl:text>
</fo:inline>
<fo:block/>
<fo:inline>
<xsl:text>Test Text</xsl:text>
</fo:inline>
</fo:block>
</fo:block-container>
<fo:block-container absolute-position="absolute" height="0.38in" left="4.82in" text-align="right" top="0in" width="2.63in" overflow="hidden">
<fo:block>
<fo:inline font-weight="bold">
<xsl:text>Page: </xsl:text>
</fo:inline>
<fo:page-number font-weight="bold"/>
<fo:inline font-weight="bold">
<xsl:text> of </xsl:text>
</fo:inline>
<fo:page-number-citation ref-id="SV_RefID_PageTotal" font-weight="bold"/>
</fo:block>
</fo:block-container>
</fo:block-container>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:static-content flow-name="even-page-footer">
<fo:block-container height="0.45in" overflow="hidden" display-align="after">
<fo:block>
<fo:block-container font-family="Arial" font-size="10pt" width="7.490000in" height="0.500000in" overflow="hidden">
<fo:block-container absolute-position="absolute" height="0.40in" left="0in" top="0in" width="4.04in" overflow="hidden">
<fo:block>
<fo:inline>
<xsl:text>My Test Form</xsl:text>
</fo:inline>
<fo:block/>
<fo:inline>
<xsl:text>Test Text</xsl:text>
</fo:inline>
</fo:block>
</fo:block-container>
<fo:block-container absolute-position="absolute" height="0.38in" left="4.82in" text-align="right" top="0in" width="2.63in" overflow="hidden">
<fo:block>
<fo:inline font-weight="bold">
<xsl:text>Page: </xsl:text>
</fo:inline>
<fo:page-number font-weight="bold"/>
<fo:inline font-weight="bold">
<xsl:text> of </xsl:text>
</fo:inline>
<fo:page-number-citation ref-id="SV_RefID_PageTotal" font-weight="bold"/>
</fo:block>
</fo:block-container>
</fo:block-container>
</fo:block>
</fo:block-container>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:for-each select="$XML">
<xsl:for-each select="DOCUMENT">
<xsl:for-each select="DATA">
<xsl:for-each select="STRUCT">
<fo:block-container font-family="Arial" font-size="10pt" width="7.500000in" height="7.040000in" overflow="hidden">
<fo:block-container absolute-position="absolute" font-family="Arial" font-size="13pt" font-weight="bold" height="0.28in" left="0in" text-align="center" top="0in" width="7.46in" overflow="hidden">
<fo:block>
<fo:inline>
<xsl:text>Form Body Starts Here </xsl:text>
</fo:inline>
<xsl:for-each select="FIELD[FNAME=&apos;nfFormTitle&apos;]">
<xsl:for-each select="VALUE">
<xsl:variable name="value-of-template_28">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains(string($value-of-template_28),'​')">
<fo:block>
<xsl:copy-of select="$value-of-template_28"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline>
<xsl:copy-of select="$value-of-template_28"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
<fo:inline>
<xsl:text> Test Test</xsl:text>
</fo:inline>
</fo:block>
</fo:block-container>
</fo:block-container>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</fo:block>
<fo:block id="SV_RefID_PageTotal"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template name="altova:double-backslash">
<xsl:param name="text"/>
<xsl:param name="text-length"/>
<xsl:variable name="text-after-bs" select="substring-after($text, '\')"/>
<xsl:variable name="text-after-bs-length" select="string-length($text-after-bs)"/>
<xsl:choose>
<xsl:when test="$text-after-bs-length = 0">
<xsl:choose>
<xsl:when test="substring($text, $text-length) = '\'">
<xsl:value-of select="concat(substring($text,1,$text-length - 1), '\\')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring($text,1,$text-length - $text-after-bs-length - 1), '\\')"/>
<xsl:call-template name="altova:double-backslash">
<xsl:with-param name="text" select="$text-after-bs"/>
<xsl:with-param name="text-length" select="$text-after-bs-length"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:MakeValueAbsoluteIfPixels">
<xsl:param name="sValue"/>
<xsl:variable name="sBeforePx" select="substring-before($sValue, 'px')"/>
<xsl:choose>
<xsl:when test="$sBeforePx">
<xsl:variable name="nLengthOfInteger">
<xsl:call-template name="altova:GetCharCountOfIntegerAtEndOfString">
<xsl:with-param name="sText" select="$sBeforePx"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="nPosOfInteger" select="string-length($sBeforePx) - $nLengthOfInteger + 1"/>
<xsl:variable name="nValuePx" select="substring($sBeforePx, $nPosOfInteger)"/>
<xsl:variable name="nValueIn" select="number($nValuePx) div number($altova:nPxPerIn)"/>
<xsl:variable name="nLengthBeforeInteger" select="string-length($sBeforePx) - $nLengthOfInteger"/>
<xsl:variable name="sRest">
<xsl:call-template name="altova:MakeValueAbsoluteIfPixels">
<xsl:with-param name="sValue" select="substring-after($sValue, 'px')"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat(substring($sBeforePx, 1, $nLengthBeforeInteger), string($nValueIn), 'in', $sRest)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sValue"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="altova:GetCharCountOfIntegerAtEndOfString">
<xsl:param name="sText"/>
<xsl:variable name="sLen" select="string-length($sText)"/>
<xsl:variable name="cLast" select="substring($sText, $sLen)"/>
<xsl:choose>
<xsl:when test="number($cLast) >= 0 and number($cLast) <= 9">
<xsl:variable name="nResultOfRest">
<xsl:call-template name="altova:GetCharCountOfIntegerAtEndOfString">
<xsl:with-param name="sText" select="substring($sText, 1, $sLen - 1)"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$nResultOfRest + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Does anyone know why this is happening?
I have multiple PDFs with the same layout, so if I need to upgrade to fop-2.3 do I have to make this change to all of my PDFs?
EDIT- 1. Thank you for the comments and the answer. Sorry it took a while to reply back, as I was working on getting approvals to post this xslt.
2. I edited the xslt as it was too big to adhere to the word limit of this post. But it still has all the important parts like beginning of the PDF body etc.
Sorry, but the best way to work out why something is different between different versions of the same software is to look through the release notes for the releases since your older version.
FOP has release notes on its website. When I was confirming that, I found this at https://xmlgraphics.apache.org/fop/1.0/changes_1.0.html, which might be what you are looking for:
Allowing non-zero borders and padding on page regions when relaxed validation is turned on. Committed by LF.
If that is the cause, then the solution would be to remove the margin-top from the fo:simple-page-master. Otherwise, there's plenty more release notes for you to look through, I'm afraid.

FO:Inline container shows nothing

Here is snippet of my xsl:
<fo:table-row height="27.8mm">
<fo:table-cell border-bottom="0.2mm solid" number-columns-spanned="2">
<fo:table border="0px solid"
border-collapse="collapse"
table-layout="fixed"
width="100%"
height="100%">
<fo:table-column column-width="110mm"/>
<fo:table-body>
<fo:table-row height="27.8mm">
<fo:table-cell border-bottom="0.2mm solid" height="28mm">
<xsl:call-template name="LabelTemplate">
<xsl:with-param name="name" select="'REFERENCE'"/>
</xsl:call-template>
<xsl:call-template name="ReferenceTemplate">
<xsl:with-param name="First" select="First"/>
<xsl:with-param name="Second" select="Second"/>
<xsl:with-param name="eNo" select="eNo"/>
</xsl:call-template>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
When using inline container inside ReferenceTemplate nothing is displayed.
<xsl:template name="ReferenceTemplate">
<xsl:param name="First"/>
<xsl:param name="Second"/>
<xsl:param name="eNo"/>
<xsl:param name="size" select="'22pt'"/>
<xsl:param name="left" select="'5pt'"/>
<xsl:param name="top" select="'15px'"/>
<xsl:param name="text-indent" select="'5px'"/>
<fo:block-container
position="absolute"
top="{$top}" left="{$left}" right="5pt"
width="auto"
border="0px solid">
<fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
<fo:block><xsl:value-of select="$Second"/></fo:block>
</fo:inline-container>
<fo:inline-container vertical-align="top" inline-progression-dimension="49.9%">
<fo:block><xsl:value-of select="$First"/></fo:block>
</fo:inline-container>
</fo:block-container>
</xsl:template>
When using this sample instead of inline container content is displayed.
<fo:block text-align-last="justify">
<xsl:value-of select="$Second"/>
<fo:leader leader-pattern="space" />
<xsl:value-of select="$First"/>
</fo:block>
I think you cannot embed an fo:inline-container into an fo:block-container.
See this reference for fo:block-container - fo:inline-container is not in the list of allowed children.

Grid-table format in XSLT

I have the following XML:
<Pattern name="Form" Date="12/18/2015 3:25 AM CST">
Swap_Conversion
<CurrentLocale />
<Patterns>
<Pattern name="Section">
Swap_Conversion
<Patterns>
<Pattern name="GroupResult" status="AUTH" inputType="19">
Ultrasound Duration
<Patterns>
<Pattern name="GridDTA">23350691</Pattern>
<Pattern name="GridDTA">56468381</Pattern>
<Pattern name="GridDTA">20218422</Pattern>
<Pattern name="GridDTA">21058661</Pattern>
<Pattern name="GridDTA">4156900</Pattern>
<Pattern name="GridDTA">20008930</Pattern>
<Pattern name="GridDTA">21197198</Pattern>
</Patterns>
<Patterns>
<Pattern name="GroupResult" status="AUTH" inputType="">
Ear Irrigation Solution
<Patterns />
<Patterns>
<Pattern name="CodedResult" status="AUTH" display="Ace Bandage :" taskAssayCode="23350691">2 inch</Pattern>
</Patterns>
</Pattern>
</Patterns>
<Patterns>
<Pattern name="GroupResult" status="AUTH" inputType="">
Frame Order Priority
<Patterns />
<Patterns>
<Pattern name="CodedResult" status="AUTH" display="Ace Bandage :" taskAssayCode="23350691">3 inch</Pattern>
</Patterns>
</Pattern>
</Patterns>
</Pattern>
</Patterns>
</Pattern>
</Patterns>
</Pattern
Currently I have the transpose which look something like:
But I want it to look something like:
Currently I had tried with which worked for transpose:
<xsl:choose>
<xsl:when test="$inputType='19'"
<xsl:variable name="groupNodeSet" select="Patterns/Pattern[#name='GroupResult']"/>
<xsl:for-each select="$groupNodeSet[position() <= ((last() + $tablecolumns - 1) div $tablecolumns)]">
<!-- loopCount indicates which table of the multiple tables that a grid control may be split into that we are currently generating-->
<xsl:variable name="loopCount" select="position()"/>
<fo:table border="1pt solid black">
<fo:table-column/>
<fo:table-column/>
<fo:table-column/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-width="thin">
<fo:block/>
</fo:table-cell>
<fo:table-cell>
<xsl:if test="$groupNodeSet[position()=((($loopCount - 1) * $tablecolumns) + 1)]">
<xsl:attribute name="border-width">
<xsl:text>thin</xsl:text>
</xsl:attribute>
</xsl:if>
<fo:block font-size="{$regularfontsize}" font-family="sans-serif" text-align="left" font-style="italic">
<xsl:value-of select="$groupNodeSet[position()=((($loopCount - 1) * $tablecolumns) + 1)]/text()"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<xsl:if test="$groupNodeSet[position()=((($loopCount - 1) * $tablecolumns) + 2)]">
<xsl:attribute name="border-width">
<xsl:text>thin</xsl:text>
</xsl:attribute>
</xsl:if>
<fo:block font-size="{$regularfontsize}" font-family="sans-serif" text-align="left" font-style="italic">
<xsl:value-of select="$groupNodeSet[position()=((($loopCount - 1) * $tablecolumns) + 2)]/text()"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="../../Patterns/Pattern[#name='GridDTA' and ../..//#taskAssayCode=text()]">
<xsl:variable name="taskassay">
<xsl:value-of select="node()"/>
</xsl:variable>
<fo:table-row>
<fo:table-cell border-width="thin">
<fo:block>
<xsl:value-of select="../..//Pattern/#display[../..//Pattern/#taskAssayCode=$taskassay]"/>
</fo:block>
</fo:table-cell>
<xsl:call-template name="GenerateGridTableCells">
<xsl:with-param name="count" select="1"/>
<xsl:with-param name="maxcount" select="$tablecolumns"/>
<xsl:with-param name="taskassay" select="$taskassay"/>
<xsl:with-param name="groupNodeSet" select="$groupNodeSet"/>
<xsl:with-param name="rowNumber" select="$loopCount"/>
</xsl:call-template>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:for-each>
</xsl:when>
</xsl:choose>
I have tried multiple approach for normal one (not the transpose) which isn't working for.
Can anyone help me in having the grid matrix without transpose for the above XML?
Since you're using XSLT 1.0, you're stuck with using Meunchian grouping (muenchian grouping, http://www.jenitennison.com/xslt/grouping/muenchian.html). Using XSLT 2.0 would have made it easier.
The version below can cope with a variations in the 'CodedResult' within each 'GroupResult'.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:variable name="regularfontsize" select="'12pt'"/>
<xsl:output indent="yes" />
<xsl:key name="coded-results"
match="Pattern[#name = 'CodedResult'][#status = 'AUTH']"
use="#display" />
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="a">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="a">
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="Pattern/Patterns/Pattern[#name = 'Section']/Patterns/Pattern" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:variable name="inputType" select="'19'" />
<xsl:template match="Pattern[#inputType = '19']">
<xsl:variable name="all-coded-results"
select="Patterns/Pattern[#inputType = '']/Patterns/Pattern[#name = 'CodedResult']
[count(. | key('coded-results', #display)[1]) = 1]" />
<fo:table border="1pt solid black">
<fo:table-column/>
<xsl:for-each
select="$all-coded-results">
<fo:table-column/>
</xsl:for-each>
<fo:table-body>
<fo:table-row>
<fo:table-cell />
<xsl:for-each
select="$all-coded-results">
<xsl:sort />
<fo:table-cell>
<fo:block>
<xsl:value-of select="#display" />
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
<xsl:apply-templates select="Patterns/Pattern[#name = 'GroupResult']">
<xsl:with-param name="all-coded-results" select="$all-coded-results" />
</xsl:apply-templates>
</fo:table-body>
</fo:table>
</xsl:template>
<xsl:template match="Pattern[#name = 'GroupResult'][#inputType = '']">
<xsl:param name="all-coded-results" />
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="normalize-space(text())" />
</fo:block>
</fo:table-cell>
<xsl:variable name="this-pattern" select="." />
<xsl:for-each
select="$all-coded-results">
<xsl:sort />
<xsl:variable name="this-result" select="."/>
<fo:table-cell>
<xsl:if test="$this-pattern/Patterns/Pattern[#display = $this-result/#display]">
<fo:block>
<xsl:value-of select="$this-pattern/Patterns/Pattern[#display = $this-result/#display]" />
</fo:block>
</xsl:if>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</xsl:template>
</xsl:stylesheet>

How to keep content together in XSL FO tables

I have XSL-FO with region-before, region-after, and region-body which has a table having 6 columns. The second column has 3 lines of data (name, address, city/state/zip). We render this into PDF.
If I simply apply my data, I will get a row at the end of the page, where the 2nd column has 1 line of text on the current page, and 2 lines end up on the next page.
If I apply keep-together="always" (or keep-together.within-column="always") my table starts on the 2nd page.
How can I get my data to page-break correctly? If I have not provided enough information, please comment and I will try to provide it.
Edit: XSL-FO attached; Added Stylesheet and XML; Added the rest of the XSLT
XML Data:
<?xml version="1.0" encoding="utf-8"?>
<AS400_ELVPLOC00Collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<COL_FILL_MODE>0</COL_FILL_MODE>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<SLMR_ERROR_LIST />
<ObjList>
<AS400_ELVPLOC00>
<ID>0</ID>
<DOC_LINK_ID>0</DOC_LINK_ID>
<EMAIL_LINK_ID>0</EMAIL_LINK_ID>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<OBJ_TYPE>AS400_ELVPLOC00</OBJ_TYPE>
<CRTD_DT>0001-01-01T00:00:00</CRTD_DT>
<MODFD_DT>0001-01-01T00:00:00</MODFD_DT>
<SLMR_ERROR_LIST />
<ELBLDGCD>11966</ELBLDGCD>
<ELBLDGCD_DISPLAY>11966</ELBLDGCD_DISPLAY>
<ELBLDGNM>TEST COMPANY</ELBLDGNM>
<ELLSTNUM>123</ELLSTNUM>
<ELLDIR></ELLDIR>
<ELLRDNUM>0</ELLRDNUM>
<ELLSTNM1>Nowhere</ELLSTNM1>
<ELLTYP1>St</ELLTYP1>
<ELLCITY>HARRISBURG</ELLCITY>
<ELLSTATE>PA</ELLSTATE>
<ELLZIPCD>17111</ELLZIPCD>
<ELLZIPCD_DISPLAY>18970</ELLZIPCD_DISPLAY>
<ELLZIPSX>0</ELLZIPSX>
<ELLZIPSX_DISPLAY />
<LOC_STREET_DISPLAY>123 Nowhere St</LOC_STREET_DISPLAY>
<LOC_STREET_DISPLAY2> </LOC_STREET_DISPLAY2>
<LOC_DISPLAY_NONUM>123 Nowhere St<br />HARRISBURG PA 17111</LOC_DISPLAY_NONUM>
<ELLCNTY>42017</ELLCNTY>
<ELLCNTY_NAME>Bucks</ELLCNTY_NAME>
<ELLCURRYY>0</ELLCURRYY>
<ELLCURRMM>0</ELLCURRMM>
<ELLCURRDD>0</ELLCURRDD>
<ELLCurrStatus_DT>0001-01-01T00:00:00</ELLCurrStatus_DT>
<FEE_CO_ID>0</FEE_CO_ID>
<INSPTR_ID>0</INSPTR_ID>
<ELLUPDTYY>0</ELLUPDTYY>
<ELLUPDTMM>0</ELLUPDTMM>
<ELLUPDTDD>0</ELLUPDTDD>
<ELLLastUpdate_DT>0001-01-01T00:00:00</ELLLastUpdate_DT>
<ELLPASTYY>0</ELLPASTYY>
<ELLPASTMM>0</ELLPASTMM>
<ELLPASTDD>0</ELLPASTDD>
<ELEPastStat_DT>0001-01-01T00:00:00</ELEPastStat_DT>
<AS400_ELVPEQP_COL>
<COL_FILL_MODE>0</COL_FILL_MODE>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<SLMR_ERROR_LIST />
<ObjList>
<AS400_ELVPEQP00>
<ID>114224</ID>
<DOC_LINK_ID>0</DOC_LINK_ID>
<EMAIL_LINK_ID>0</EMAIL_LINK_ID>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<OBJ_TYPE>AS400_ELVPEQP00</OBJ_TYPE>
<CRTD_DT>0001-01-01T00:00:00</CRTD_DT>
<MODFD_DT>0001-01-01T00:00:00</MODFD_DT>
<SLMR_ERROR_LIST />
<ELBLDGCD>11966</ELBLDGCD>
<ELEEQNO>1</ELEEQNO>
<ELEEQNO_DISPLAY>001</ELEEQNO_DISPLAY>
<ELEDTINY>1947</ELEDTINY>
<ELEDTINM>10</ELEDTINM>
<ELEDTIND>2</ELEDTIND>
<ELEInitInsp_DT>1947-10-02T00:00:00</ELEInitInsp_DT>
<ELEIRSLT>P</ELEIRSLT>
<ELEICDTY>0</ELEICDTY>
<ELEICDTM>0</ELEICDTM>
<ELEICDTD>0</ELEICDTD>
<ELEClear_DT>1900-01-01T00:00:00</ELEClear_DT>
<ELPERMTNO>194703851</ELPERMTNO>
<ELEPERMID>N</ELEPERMID>
<ELEDTISY>0</ELEDTISY>
<ELEDTISM>0</ELEDTISM>
<ELEDTISD>0</ELEDTISD>
<ELEPermitIssued_DT>1900-01-01T00:00:00</ELEPermitIssued_DT>
<ELELSEAL />
<ELEYCEXP>0</ELEYCEXP>
<ELEMCEXP>0</ELEMCEXP>
<ELECEXP_DT>0001-01-01T00:00:00</ELECEXP_DT>
<ELEYCISS>0</ELEYCISS>
<ELEMCISS>0</ELEMCISS>
<ELOFLNUM>11966</ELOFLNUM>
<ELERPNUM>11966</ELERPNUM>
<ELETYPELV>F</ELETYPELV>
<ELEINSPD>2</ELEINSPD>
<ELEDTWINY>0</ELEDTWINY>
<ELEDTWINM>0</ELEDTWINM>
<ELEDTWIND>0</ELEDTWIND>
<ELEMajRepair_DT>1900-01-01T00:00:00</ELEMajRepair_DT>
<ELEWCDTY>0</ELEWCDTY>
<ELEWCDTM>0</ELEWCDTM>
<ELEWCDTD>0</ELEWCDTD>
<ELEMajRepairClear_DT>1900-01-01T00:00:00</ELEMajRepairClear_DT>
<ELEDTLINY>2008</ELEDTLINY>
<ELEDTLINM>2</ELEDTLINM>
<ELEDTLIND>21</ELEDTLIND>
<ELELastInsp_DT>2008-02-21T00:00:00</ELELastInsp_DT>
<ELELAST_INSP_ID>1369887</ELELAST_INSP_ID>
<ELEUPDTYY>0</ELEUPDTYY>
<ELEUPDTMM>0</ELEUPDTMM>
<ELEUPDTDD>0</ELEUPDTDD>
<ELELastUpdate_DT>0001-01-01T00:00:00</ELELastUpdate_DT>
<ELELocId>0</ELELocId>
<ELEBldgOpwnId>0</ELEBldgOpwnId>
<ELERespOwnId>0</ELERespOwnId>
<ELEPassID>0</ELEPassID>
<ELESkiID>0</ELESkiID>
<ELEWclID>0</ELEWclID>
<ELEECOCD_ID>0</ELEECOCD_ID>
<ELEEORIG_ID>0</ELEEORIG_ID>
<FIRST_INSP_ID>0</FIRST_INSP_ID>
<LAST_MAJ_REP_INSP_ID>0</LAST_MAJ_REP_INSP_ID>
</AS400_ELVPEQP00>
<AS400_ELVPEQP00>
<ID>114225</ID>
<DOC_LINK_ID>0</DOC_LINK_ID>
<EMAIL_LINK_ID>0</EMAIL_LINK_ID>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<OBJ_TYPE>AS400_ELVPEQP00</OBJ_TYPE>
<CRTD_DT>0001-01-01T00:00:00</CRTD_DT>
<MODFD_DT>0001-01-01T00:00:00</MODFD_DT>
<SLMR_ERROR_LIST />
<ELBLDGCD>11966</ELBLDGCD>
<ELEEQNO>2</ELEEQNO>
<ELEEQNO_DISPLAY>002</ELEEQNO_DISPLAY>
<ELEDTINY>1947</ELEDTINY>
<ELEDTINM>10</ELEDTINM>
<ELEDTIND>2</ELEDTIND>
<ELEInitInsp_DT>1947-10-02T00:00:00</ELEInitInsp_DT>
<ELEIRSLT>P</ELEIRSLT>
<ELEICDTY>0</ELEICDTY>
<ELEICDTM>0</ELEICDTM>
<ELEICDTD>0</ELEICDTD>
<ELEClear_DT>1900-01-01T00:00:00</ELEClear_DT>
<ELPERMTNO>194703851</ELPERMTNO>
<ELEPERMID>N</ELEPERMID>
<ELEDTISY>0</ELEDTISY>
<ELEDTISM>0</ELEDTISM>
<ELEDTISD>0</ELEDTISD>
<ELEPermitIssued_DT>1900-01-01T00:00:00</ELEPermitIssued_DT>
<ELELSEAL />
<ELEYCEXP>0</ELEYCEXP>
<ELEMCEXP>0</ELEMCEXP>
<ELECEXP_DT>0001-01-01T00:00:00</ELECEXP_DT>
<ELEYCISS>0</ELEYCISS>
<ELEMCISS>0</ELEMCISS>
<ELOFLNUM>11966</ELOFLNUM>
<ELERPNUM>11966</ELERPNUM>
<ELETYPELV>F</ELETYPELV>
<ELEINSPD>2</ELEINSPD>
<ELEDTWINY>0</ELEDTWINY>
<ELEDTWINM>0</ELEDTWINM>
<ELEDTWIND>0</ELEDTWIND>
<ELEMajRepair_DT>1900-01-01T00:00:00</ELEMajRepair_DT>
<ELEWCDTY>0</ELEWCDTY>
<ELEWCDTM>0</ELEWCDTM>
<ELEWCDTD>0</ELEWCDTD>
<ELEMajRepairClear_DT>1900-01-01T00:00:00</ELEMajRepairClear_DT>
<ELEDTLINY>2008</ELEDTLINY>
<ELEDTLINM>2</ELEDTLINM>
<ELEDTLIND>21</ELEDTLIND>
<ELELastInsp_DT>2008-02-21T00:00:00</ELELastInsp_DT>
<ELELAST_INSP_ID>1369887</ELELAST_INSP_ID>
<ELEUPDTYY>0</ELEUPDTYY>
<ELEUPDTMM>0</ELEUPDTMM>
<ELEUPDTDD>0</ELEUPDTDD>
<ELELastUpdate_DT>0001-01-01T00:00:00</ELELastUpdate_DT>
<ELELocId>0</ELELocId>
<ELEBldgOpwnId>0</ELEBldgOpwnId>
<ELERespOwnId>0</ELERespOwnId>
<ELEPassID>0</ELEPassID>
<ELESkiID>0</ELESkiID>
<ELEWclID>0</ELEWclID>
<ELEECOCD_ID>0</ELEECOCD_ID>
<ELEEORIG_ID>0</ELEEORIG_ID>
<FIRST_INSP_ID>0</FIRST_INSP_ID>
<LAST_MAJ_REP_INSP_ID>0</LAST_MAJ_REP_INSP_ID>
</AS400_ELVPEQP00>
</ObjList>
<Sort_Expression />
<Sort_Expression_List />
<Sort_Direction>Asc</Sort_Direction>
<SEARCH_ELBLDGCD>0</SEARCH_ELBLDGCD>
<SEARCH_ELEEQNO>0</SEARCH_ELEEQNO>
<SEARCH_ELEFLNUM>0</SEARCH_ELEFLNUM>
<SEARCH_ELERPNUM>0</SEARCH_ELERPNUM>
<SEARCH_ELPERMTNO>0</SEARCH_ELPERMTNO>
<SEARCH_ELPERMTNO_LIST />
<SEARCH_INSPTRID>0</SEARCH_INSPTRID>
<SEARCH_INSPNDT_START>12:00:00 AM</SEARCH_INSPNDT_START>
<SEARCH_INSPNDT_END>12:00:00 AM</SEARCH_INSPNDT_END>
</AS400_ELVPEQP_COL>
<LastEqpNum>0</LastEqpNum>
<NumOfEqp>0</NumOfEqp>
<PRVNC>0</PRVNC>
<CTRY>0</CTRY>
<DIVN>ELV</DIVN>
<FILE_NUMBER>0</FILE_NUMBER>
<OWNER_ID>0</OWNER_ID>
<Original_ObjType>AS400_ELVPLOC00</Original_ObjType>
<ASGD_WRKLD_INSPTR_ID>0</ASGD_WRKLD_INSPTR_ID>
</AS400_ELVPLOC00>
<AS400_ELVPLOC00>
<ID>0</ID>
<DOC_LINK_ID>0</DOC_LINK_ID>
<EMAIL_LINK_ID>0</EMAIL_LINK_ID>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<OBJ_TYPE>AS400_ELVPLOC00</OBJ_TYPE>
<CRTD_DT>0001-01-01T00:00:00</CRTD_DT>
<MODFD_DT>0001-01-01T00:00:00</MODFD_DT>
<SLMR_ERROR_LIST />
<ELBLDGCD>26778</ELBLDGCD>
<ELBLDGCD_DISPLAY>26778</ELBLDGCD_DISPLAY>
<ELBLDGNM>ANOTHER COMPANY</ELBLDGNM>
<ELLSTNUM />
<ELLDIR>E</ELLDIR>
<ELLRDNUM>0</ELLRDNUM>
<ELLSTNM1>POST</ELLSTNM1>
<ELLTYP1>RD</ELLTYP1>
<ELLCITY>HARRISBURG</ELLCITY>
<ELLSTATE>PA</ELLSTATE>
<ELLZIPCD>17111</ELLZIPCD>
<ELLZIPCD_DISPLAY>19067</ELLZIPCD_DISPLAY>
<ELLZIPSX>0</ELLZIPSX>
<ELLZIPSX_DISPLAY />
<LOC_STREET_DISPLAY>E POST RD</LOC_STREET_DISPLAY>
<LOC_STREET_DISPLAY2> </LOC_STREET_DISPLAY2>
<LOC_DISPLAY_NONUM>ANOTHER COMPANY<br />E POST RD<br />HARRISBURG PA 17111</LOC_DISPLAY_NONUM>
<ELLCNTY>42017</ELLCNTY>
<ELLCNTY_NAME>Bucks</ELLCNTY_NAME>
<ELLCURRYY>0</ELLCURRYY>
<ELLCURRMM>0</ELLCURRMM>
<ELLCURRDD>0</ELLCURRDD>
<ELLCurrStatus_DT>0001-01-01T00:00:00</ELLCurrStatus_DT>
<FEE_CO_ID>0</FEE_CO_ID>
<INSPTR_ID>0</INSPTR_ID>
<ELLUPDTYY>0</ELLUPDTYY>
<ELLUPDTMM>0</ELLUPDTMM>
<ELLUPDTDD>0</ELLUPDTDD>
<ELLLastUpdate_DT>0001-01-01T00:00:00</ELLLastUpdate_DT>
<ELLPASTYY>0</ELLPASTYY>
<ELLPASTMM>0</ELLPASTMM>
<ELLPASTDD>0</ELLPASTDD>
<ELEPastStat_DT>0001-01-01T00:00:00</ELEPastStat_DT>
<AS400_ELVPEQP_COL>
<COL_FILL_MODE>0</COL_FILL_MODE>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<SLMR_ERROR_LIST />
<ObjList>
<AS400_ELVPEQP00>
<ID>77581</ID>
<DOC_LINK_ID>0</DOC_LINK_ID>
<EMAIL_LINK_ID>0</EMAIL_LINK_ID>
<IS_CHANGED>false</IS_CHANGED>
<IS_CHILDREN>true</IS_CHILDREN>
<OBJ_TYPE>AS400_ELVPEQP00</OBJ_TYPE>
<CRTD_DT>0001-01-01T00:00:00</CRTD_DT>
<MODFD_DT>0001-01-01T00:00:00</MODFD_DT>
<SLMR_ERROR_LIST />
<ELBLDGCD>26778</ELBLDGCD>
<ELEEQNO>7</ELEEQNO>
<ELEEQNO_DISPLAY>007</ELEEQNO_DISPLAY>
<ELEDTINY>0</ELEDTINY>
<ELEDTINM>0</ELEDTINM>
<ELEDTIND>0</ELEDTIND>
<ELEInitInsp_DT>1900-01-01T00:00:00</ELEInitInsp_DT>
<ELEIRSLT />
<ELEICDTY>0</ELEICDTY>
<ELEICDTM>0</ELEICDTM>
<ELEICDTD>0</ELEICDTD>
<ELEClear_DT>1900-01-01T00:00:00</ELEClear_DT>
<ELPERMTNO>0</ELPERMTNO>
<ELEPERMID>M0</ELEPERMID>
<ELEDTISY>0</ELEDTISY>
<ELEDTISM>0</ELEDTISM>
<ELEDTISD>0</ELEDTISD>
<ELEPermitIssued_DT>1900-01-01T00:00:00</ELEPermitIssued_DT>
<ELELSEAL />
<ELEYCEXP>0</ELEYCEXP>
<ELEMCEXP>0</ELEMCEXP>
<ELECEXP_DT>0001-01-01T00:00:00</ELECEXP_DT>
<ELEYCISS>0</ELEYCISS>
<ELEMCISS>0</ELEMCISS>
<ELOFLNUM>26778</ELOFLNUM>
<ELERPNUM>26778</ELERPNUM>
<ELETYPELV>F</ELETYPELV>
<ELEINSPD>2</ELEINSPD>
<ELEDTWINY>0</ELEDTWINY>
<ELEDTWINM>0</ELEDTWINM>
<ELEDTWIND>0</ELEDTWIND>
<ELEMajRepair_DT>1900-01-01T00:00:00</ELEMajRepair_DT>
<ELEWCDTY>0</ELEWCDTY>
<ELEWCDTM>0</ELEWCDTM>
<ELEWCDTD>0</ELEWCDTD>
<ELEMajRepairClear_DT>1900-01-01T00:00:00</ELEMajRepairClear_DT>
<ELEDTLINY>2010</ELEDTLINY>
<ELEDTLINM>6</ELEDTLINM>
<ELEDTLIND>3</ELEDTLIND>
<ELELastInsp_DT>2010-06-03T00:00:00</ELELastInsp_DT>
<ELELAST_INSP_ID>1547374</ELELAST_INSP_ID>
<ELEUPDTYY>0</ELEUPDTYY>
<ELEUPDTMM>0</ELEUPDTMM>
<ELEUPDTDD>0</ELEUPDTDD>
<ELELastUpdate_DT>0001-01-01T00:00:00</ELELastUpdate_DT>
<ELELocId>0</ELELocId>
<ELEBldgOpwnId>0</ELEBldgOpwnId>
<ELERespOwnId>0</ELERespOwnId>
<ELEPassID>0</ELEPassID>
<ELESkiID>0</ELESkiID>
<ELEWclID>0</ELEWclID>
<ELEECOCD_ID>0</ELEECOCD_ID>
<ELEEORIG_ID>0</ELEEORIG_ID>
<FIRST_INSP_ID>0</FIRST_INSP_ID>
<LAST_MAJ_REP_INSP_ID>0</LAST_MAJ_REP_INSP_ID>
</AS400_ELVPEQP00>
</ObjList>
<Sort_Expression />
<Sort_Expression_List />
<Sort_Direction>Asc</Sort_Direction>
<SEARCH_ELBLDGCD>0</SEARCH_ELBLDGCD>
<SEARCH_ELEEQNO>0</SEARCH_ELEEQNO>
<SEARCH_ELEFLNUM>0</SEARCH_ELEFLNUM>
<SEARCH_ELERPNUM>0</SEARCH_ELERPNUM>
<SEARCH_ELPERMTNO>0</SEARCH_ELPERMTNO>
<SEARCH_ELPERMTNO_LIST />
<SEARCH_INSPTRID>0</SEARCH_INSPTRID>
<SEARCH_INSPNDT_START>12:00:00 AM</SEARCH_INSPNDT_START>
<SEARCH_INSPNDT_END>12:00:00 AM</SEARCH_INSPNDT_END>
</AS400_ELVPEQP_COL>
<LastEqpNum>0</LastEqpNum>
<NumOfEqp>0</NumOfEqp>
<PRVNC>0</PRVNC>
<CTRY>0</CTRY>
<DIVN>ELV</DIVN>
<FILE_NUMBER>0</FILE_NUMBER>
<OWNER_ID>0</OWNER_ID>
<Original_ObjType>AS400_ELVPLOC00</Original_ObjType>
<ASGD_WRKLD_INSPTR_ID>0</ASGD_WRKLD_INSPTR_ID>
</AS400_ELVPLOC00>
</ObjList>
<Sort_Expression />
<Sort_Expression_List />
<Sort_Direction>Asc</Sort_Direction>
<SEARCH_ELBLDGCD>0</SEARCH_ELBLDGCD>
<SEARCH_ELBLDGNM />
<SEARCH_ELLCITY />
<SEARCH_ELOFLNUM>0</SEARCH_ELOFLNUM>
<SEARCH_ELLSTNAME />
<SEARCH_Counties>42017,42075</SEARCH_Counties>
<SEARCH_FromDate>2011-01-01T00:00:00</SEARCH_FromDate>
<SEARCH_ToDate>2014-06-30T00:00:00</SEARCH_ToDate>
</AS400_ELVPLOC00Collection>
Print_Stylesheet.txt (attribute-sets)
<xsl:attribute-set name="table">
<xsl:attribute name="font-family">Arial</xsl:attribute>
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="table-layout">fixed</xsl:attribute>
<xsl:attribute name="space-before">10pt</xsl:attribute>
<xsl:attribute name="space-after">10pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.th" >
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-color">black</xsl:attribute>
<xsl:attribute name="border-width">1pt</xsl:attribute>
<xsl:attribute name="padding-start">0.3em</xsl:attribute>
<xsl:attribute name="padding-end">0.2em</xsl:attribute>
<xsl:attribute name="padding-before">2pt</xsl:attribute>
<xsl:attribute name="padding-after">2pt</xsl:attribute>
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.td_title" >
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-color">black</xsl:attribute>
<xsl:attribute name="border-width">1pt</xsl:attribute>
<xsl:attribute name="padding-start">0.3em</xsl:attribute>
<xsl:attribute name="padding-end">0.2em</xsl:attribute>
<xsl:attribute name="padding-before">2pt</xsl:attribute>
<xsl:attribute name="padding-after">2pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.td_data" >
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-color">black</xsl:attribute>
<xsl:attribute name="border-width">1pt</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="padding-start">0.5em</xsl:attribute>
<xsl:attribute name="padding-end">0.3em</xsl:attribute>
<xsl:attribute name="padding-before">2pt</xsl:attribute>
<xsl:attribute name="padding-after">2pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table_PLAN_APRVL">
<xsl:attribute name="font-family">Arial</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="line-height">14pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.td_titleCell">
<xsl:attribute name="line-height">10pt</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="padding-start">0.3em</xsl:attribute>
<xsl:attribute name="padding-end">0.2em</xsl:attribute>
<xsl:attribute name="padding-before">1pt</xsl:attribute>
<xsl:attribute name="padding-after">1pt</xsl:attribute>
<xsl:attribute name="border-left-style">solid</xsl:attribute>
<xsl:attribute name="border-left-width">thin</xsl:attribute>
<xsl:attribute name="border-right-style">solid</xsl:attribute>
<xsl:attribute name="border-right-width">thin</xsl:attribute>
<xsl:attribute name="border-top-style">solid</xsl:attribute>
<xsl:attribute name="border-top-width">thin</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.td_innerTitleCell">
<xsl:attribute name="vertical-align">sub</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="padding-end">0.1em</xsl:attribute>
<xsl:attribute name="padding-before">1pt</xsl:attribute>
<xsl:attribute name="padding-after">1pt</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.data.td_innerCell">
<xsl:attribute name="vertical-align">sub</xsl:attribute>
<xsl:attribute name="font-size">9pt</xsl:attribute>
<xsl:attribute name="padding-before">1pt</xsl:attribute>
<xsl:attribute name="padding-after">1pt</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="OCR.Data">
<xsl:attribute name="font-family">OCR A Extended</xsl:attribute>
<xsl:attribute name="font-size">13pt</xsl:attribute>
<xsl:attribute name="font-weight">normal</xsl:attribute>
<xsl:attribute name="font-color">black</xsl:attribute>
</xsl:attribute-set>
Section from XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<!--Style Sheet-->
<!--Helper Tools-->
<xsl:variable name="ind" select="0" />
<xsl:attribute-set name="table.cell">
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-color">black</xsl:attribute>
<xsl:attribute name="border-width">normal</xsl:attribute>
<xsl:attribute name="font-size">7pt</xsl:attribute>
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="padding-before">2pt</xsl:attribute>
<xsl:attribute name="padding-after">2pt</xsl:attribute>
</xsl:attribute-set>
<xsl:key name="county" match="ObjList/AS400_ELVPLOC00" use="ELLCNTY_NAME" />
<xsl:template match="AS400_ELVPLOC00Collection">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple"
page-height="11in"
page-width="8.5in"
margin-top="0.125in"
margin-bottom="0.125in"
margin-left="0.325in"
margin-right="0.325in">
<fo:region-body margin-top="1.125in"
margin-bottom="0.75in"
margin-left="0in"
margin-right="1in"
/>
<fo:region-before region-name="xsl-region-before" extent="1in" />
<fo:region-after region-name="xsl-region-after" extent="0.0in" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<!-- Page Header-->
<fo:static-content flow-name="xsl-region-before">
</fo:static-content>
<!--Footer-->
<fo:static-content flow-name="xsl-region-after" >
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:for-each select="ObjList/AS400_ELVPLOC00[generate-id(.)=generate-id(key('county',ELLCNTY_NAME)[1])]">
<fo:flow flow-name="xsl-region-body">
<xsl:for-each select="ObjList/AS400_ELVPLOC00[generate-id(.)=generate-id(key('county',ELLCNTY_NAME)[1])]">
<fo:table xsl:use-attribute-sets="table" space-after="0pt" break-after="page">
<fo:table-column column-number="1" column-width="0.75in" />
<!-- LOC NO -->
<fo:table-column column-number="2" column-width="2.85in" />
<!-- LOCATION -->
<fo:table-column column-number="3" column-width="1.5in" />
<!-- EQP/TYPE -->
<fo:table-column column-number="4" column-width="1.25in" />
<!-- INSP DATE -->
<fo:table-column column-number="5" column-width="0.125in" />
<!-- ? -->
<fo:table-column column-number="6" column-width="2.0in" />
<!-- HISTORY -->
<fo:table-header>
<!-- Grid Header -->
<fo:table-row>
<fo:table-cell number-columns-spanned="2">
<fo:block>
<xsl:text>FOR </xsl:text>
<xsl:value-of select="ELLCNTY_NAME" />
<xsl:text> COUNTY</xsl:text>
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="4">
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block padding-after="10pt">
LOC NO
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block>
LOCATION
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block>
EQP/TYPE
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block>
INSP DATE
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block>
HISTORY
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<!-- Table Grid -->
<fo:table-body>
<xsl:for-each select="key('county',ELLCNTY_NAME)">
<xsl:sort select="ELBLDGCD_DISPLAY" />
<fo:table-row padding-after="4pt">
<fo:table-cell>
<fo:block>
<xsl:value-of select="ELBLDGCD_DISPLAY" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding-after="5pt">
<fo:block>
<fo:block>
<xsl:value-of select="ELBLDGNM"/>
</fo:block>
<fo:block>
<xsl:value-of select="LOC_STREET_DISPLAY"/>
</fo:block>
<fo:block>
<xsl:value-of select="ELLCITY"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="ELLSTATE"/>
<xsl:text> </xsl:text>
<xsl:value-of select="ELLZIPCD"/>
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-after="5pt">
<fo:block>
<xsl:text>...</xsl:text>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-after="5pt">
<fo:block>
<xsl:text>...</xsl:text>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-after="5pt">
<fo:block>
<xsl:text>...</xsl:text>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-after="5pt">
<fo:block>
<xsl:text>...</xsl:text>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:for-each>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
After fixing a few issues in your posted XSL and examining the results, I believe what you want is the whole row in the repeating table is always kept together on a page. If yes, then you would do this in your XSL:
<xsl:for-each select="key('county',ELLCNTY_NAME)">
<xsl:sort select="ELBLDGCD_DISPLAY" />
<fo:table-row padding-after="4pt" keep-together.within-page="always">
You can get the same effect by setting that value on the exact table-cell:
<fo:table-cell padding-after="5pt" keep-together.within-page="always">
<fo:block>
<fo:block>
<xsl:value-of select="ELBLDGNM"/>
</fo:block>
<fo:block>
<xsl:value-of select="LOC_STREET_DISPLAY"/>
</fo:block>
<fo:block>
<xsl:value-of select="ELLCITY"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="ELLSTATE"/>
<xsl:text> </xsl:text>
<xsl:value-of select="ELLZIPCD"/>
</fo:block>
</fo:block>
</fo:table-cell>
Or even the containing block that contains all the lines inside the table cell. The difference would be whether this is the only thing you want kept together or if you want the whole row kept together.
Also note, this has nothing to do with MSXML, that tag should be removed. It is a pure XSL FO keep question and does not matter what XSLT engine you use.
The resulting PDF shows that those cells are not broken from page to page:

Wrap within table-cell with long word in FOP

I have a table in FOP and it is working nicely until I get a very long word. The word then overwrites the cell ending in the table. I tried the wrap-option="wrap" within the table-cell and/or the block of the cell but it doesn't work
**Total Edit**
since I guess it is to complicated to just show bits here is the complete xsl file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" />
<xsl:param name="tableCell" select="'1.0'" />
<!-- Globale Variablen START -->
<xsl:param name="tabbgcolor" select="'#EEEEEE'" />
<!-- Globale Variablen ENDE -->
<xsl:template match="/datasheet">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<fo:layout-master-set>
<fo:simple-page-master page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1.5cm" margin-right="1.5cm" master-name="first">
<fo:region-body margin-top="20mm" margin-bottom="20mm" />
<fo:region-before extent="15mm" />
<fo:region-after extent="15mcm" />
</fo:simple-page-master>
<fo:simple-page-master master-name="new" margin-right="1.0cm" margin-left="1.0cm" margin-bottom="1cm" margin-top="1cm" page-height="21cm" page-width="29.7cm">
<fo:region-body margin-top="30mm" margin-bottom="20mm" />
<fo:region-before extent="30mm" />
<fo:region-after extent="15mm" />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence language="de" country="DE" master-reference="new" initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block text-align="center" font-size="12pt" padding="5pt" font-weight="bold">
<xsl:value-of select="title" />
</fo:block>
<fo:block text-align="right" font-size="12pt" padding="5pt" font-weight="bold">
<xsl:value-of select="date" />
</fo:block>
<fo:block text-align="right" font-size="12pt" padding="0pt" font-weight="bold">
<xsl:value-of select="time" />
</fo:block>
<fo:block>
<fo:leader leader-length="100%" leader-pattern="rule" rule-thickness="2pt" color="black" />
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center">
Seite
<fo:page-number />
von
<fo:page-number-citation ref-id="TheVeryLastPage" />
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:leader />
</fo:block>
<fo:block>
<fo:leader />
</fo:block>
<fo:block>
<fo:leader />
</fo:block>
<fo:block font-weight="bold" padding="5pt" padding-top="25pt">
Jahre <xsl:value-of select="fromYear" /> bis <xsl:value-of select="toYear" />
</fo:block>
<fo:block text-align="center">
<xsl:choose>
<xsl:when test="dataList != ''">
<fo:table table-layout="fixed" width="100%" border-style="solide" border-width="1pt">
<fo:table-column column-width="25%" border-style="solid" border-width="1pt" />
<fo:table-column column-width="25%" border-style="solid" border-width="1pt" />
<fo:table-column column-width="25%" border-style="solid" border-width="1pt" />
<fo:table-column column-width="25%" border-style="solid" border-width="1pt" />
<fo:table-header>
<fo:table-row>
<fo:table-cell border-style="solid" font-weight="bold" border-width="0pt">
<fo:block>
Cell1
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" font-weight="bold" border-width="0pt">
<fo:block>
Cell2
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" font-weight="bold" border-width="0pt">
<fo:block>
Cell3
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" font-weight="bold" border-width="0pt">
<fo:block>
Cell4
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="dataList">
<fo:table-row>
<fo:table-cell padding="5pt" border-style="solid" border-width="1pt">
<fo:block text-align="left">
<xsl:value-of select="data1" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding="5pt" border-style="solid" border-width="1pt">
<fo:block text-align="left">
<xsl:value-of select="data2" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding="5pt" border-style="solid" border-width="1pt">
<fo:block text-align="left">
<xsl:value-of select="data3" />
</fo:block>
</fo:table-cell>
<fo:table-cell padding="5pt" border-style="solid" border-width="1pt">
<fo:block text-align="left">
<xsl:call-template name="intersperse-with-zero-spaces">
<xsl:with-param name="str" select="data4"/>
</xsl:call-template>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:when>
<xsl:otherwise>
<fo:block padding="6cm" text-align="center" font-weight="bold" font-size="16pt">No data.
</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<fo:block id="TheVeryLastPage">
</fo:block>
</fo:flow>
</fo:page-sequence>
<!-- ___________________________________________________________________________________________________________ -->
</fo:root>
</xsl:template>
<xsl:template name="intersperse-with-zero-spaces">
<xsl:param name="str"/>
<xsl:variable name="spacechars">
      
     ​
</xsl:variable>
<xsl:if test="string-length($str) > 0">
<xsl:variable name="c1" select="substring($str, 1, 1)"/>
<xsl:variable name="c2" select="substring($str, 2, 1)"/>
<xsl:value-of select="$c1"/>
<xsl:if test="$c2 != '' and
not(contains($spacechars, $c1) or
contains($spacechars, $c2))">
<xsl:text>​</xsl:text>
</xsl:if>
<xsl:call-template name="intersperse-with-zero-spaces">
<xsl:with-param name="str" select="substring($str, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
The cell data4 is the one with the problems.... like 255 digits or characters at once with no hyphen oder space.
The input is from a database but could be like:
<datasheet>
<dataList>
<data1>intro</data1>
<data2>section</data2>
<data3>cutters</data3>
<data4>743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348</data4>
</dataList>
</datasheet>
the result should be a table like:
|cell1 |cell2 |cell3 |cell4 |
_________________________________
|intro |section|cutters|7435767|
|4687635|
|7467569|
|3846576|
_________________________________
and so on in cell 4
Now the above works
<xsl:template name="intersperse-with-zero-spaces">
<xsl:param name="str"/>
<xsl:variable name="spacechars">
      
     ​
</xsl:variable>
<xsl:if test="string-length($str) > 0">
<xsl:variable name="c1" select="substring($str, 1, 1)"/>
<xsl:variable name="c2" select="substring($str, 2, 1)"/>
<xsl:value-of select="$c1"/>
<xsl:if test="$c2 != '' and
not(contains($spacechars, $c1) or
contains($spacechars, $c2))">
<xsl:text>​</xsl:text>
</xsl:if>
<xsl:call-template name="intersperse-with-zero-spaces">
<xsl:with-param name="str" select="substring($str, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
calling place use to call like below:
<fo:block text-align="left">
<xsl:call-template name="intersperse-with-zero-spaces">
<xsl:with-param name="str" select="data4"/>
</xsl:call-template>
</fo:block>
I tested, it's working fine.
One option would be for you to break up the long number/word in XSLT while you're transforming to FO. You'd have to decide where you want it to break.
See also:
XSL-FO fop. Long text flows into adjacent cells/block, obscuring stuff there
Update (copied from comment):
There must be copy/paste errors in the stylesheet... there is an <xsl:param>, which is only supposed to occur at the beginning of a template, in the middle of the template. The stylesheet is therefore invalid. Are there supposed to be two templates? Also, I don't yet see the template named intersperse-with-zero-spaces; but maybe you're still adding it.
Update 2:
The above has been fixed in the Question.
I had assumed the second template couldn't be intersperse-with-zero-spaces, since it was calling that template. It didn't occur to me that it was supposed to be a recursive template!
By the way, if you have the option of using XSLT 2.0, the intersperse-with-zero-spaces template could be replaced by a much more efficient regexp replace.
Add hyphenate="true", then it will automatically adjust the spaces in the table cell.
<fo:table-cell border-bottom-width="0px" border-left-width="0px"
border-right-width="0px" border-top-width="0px" font-size="9px"
padding-left="0px" border-style="solid" border-width="1pt"
border-color="white" padding-start="0px" padding-end="2px"
padding-before="0px" padding-after="0px" width="16%" display-align="center"
text-align="start" hyphenate="true">