I am using the XML below:
<root>
<Products name="product01">
<Instruments name="ins01"/>
<Instruments name="ins02"/>
<Instruments name="ins01"/>
</Products>
<Products name="product02">
<Instruments name="random text A">
<Bill name="A"/>
</Instruments>
<Instruments name="random text B and C">
<Bill name="B">
<Notes>some text</Notes>
</Bill>
<Bill name="C">
<Notes>some text</Notes>
</Bill>
</Instruments>
<Instruments name="random text A and B">
<Bill name="A">
<Notes>some text</Notes>
</Bill>
<Bill name="B">
<Notes>some text</Notes>
</Bill>
</Instruments>
<Instruments name="random text B">
<Bill name="B">
<Notes>some text</Notes>
</Bill>
</Instruments>
<Instruments name="random text C">
<Bill name="C">
<Notes>some text</Notes>
</Bill>
</Instruments>
<Instruments name="random text C and A">
<Bill name="C">
<Notes>some text</Notes>
</Bill>
<Bill name="A">
<Notes>some text</Notes>
</Bill>
</Instruments>
</Products>
</root>
First, I am grouping after Products, then grouping after Bills, on the left table-column, while the right table-column should only display the Instruments name, based on the Bill Type grouping from first column. As an example of above XML, I am trying to achieve this:
product02
Bill Type: A random text A
random text A and B
random text C and A
Bill Type: B random text B and C
random text A and B
random text B
Bill Type: C random text B and C
random text C
random text C and A
A sample of my template is below:
<xsl:key name="groupProducts" match="/root/Products/Instruments/Bill" use="../../#name" />
<xsl:key name="groupBilling" match="/root/Products/Instruments/Bill" use="concat(../../#name,#name)" />
<xsl:template name="myTemplate">
<fo:block>
<fo:table>
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-body>
<xsl:for-each select="/root/Products/Instruments/Bill[generate-id(.) = generate-id(key('groupProducts',../../#name)[1])]">
<fo:table-row>
<fo:table-cell>
<fo:block font-weight="bold" margin-top="4pt">
<xsl:value-of select="../../#name" />
</fo:block>
<fo:block>
<fo:table>
<fo:table-column column-width="50.000" column-number="1" />
<fo:table-column column-width="50.000" column-number="2" />
<fo:table-body>
<xsl:for-each select="/root/Products/Instruments/Bill[generate-id(.) = generate-id(key('groupBilling',concat(current()/../../#name,#name))[1])]">
<fo:table-row>
<fo:table-cell>
<fo:block color="blue">
Bill Type: <xsl:value-of select="#name" /></fo:block>
<fo:block />
</fo:table-cell>
<fo:table-cell>
<fo:block>
<fo:table>
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-body>
<xsl:for-each select="../.">
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="#name" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
For the for-each on the right table-column, I also tried the following:
<xsl:for-each select="../.">
../*[score/#naam = current()/score/#naam]
../node()[score/#naam = current()/score/#naam]
/root/Products/Instruments, but none works.
Any help is greatly appreciated.
While I cannot follow your attempted XSLT with fo namespace, consider this shortened XSLT running the Muenchian Method rendering an HTML version of desired output:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="no" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:key name="bill_key" match="Bill" use="#name"/>
<xsl:template match="/root">
<html>
<xsl:apply-templates select="Products[descendant::Bill]"/>
</html>
</xsl:template>
<xsl:template match="Products">
<table>
<tr>
<td><xsl:value-of select="#name"/></td>
<td></td>
</tr>
<xsl:apply-templates select="Instruments"/>
<tr></tr>
</table>
</xsl:template>
<xsl:template match="Instruments">
<xsl:apply-templates select="Bill[generate-id() =
generate-id(key('bill_key', #name))]"/>
</xsl:template>
<xsl:template match="Bill">
<xsl:for-each select="key('bill_key', #name)">
<tr>
<xsl:if test="position() = 1">
<td><xsl:value-of select="concat('Bill Type: ', #name)"/></td>
</xsl:if>
<xsl:if test="position() > 1">
<td></td>
</xsl:if>
<td><xsl:value-of select="../#name"/></td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hopefully you can adjust the <table>, <tr>, <td> tags to your fo styling.
Online Demo (click HTML to view output)
HTML Table Output
product02
Bill Type: A random text A
random text A and B
random text C and A
Bill Type: B random text B and C
random text A and B
random text B
Bill Type: C random text B and C
random text C
random text C and A
Related
I want to create a table Which contain two columns as product type and number of quantity in XSL-Fo.
In the XML input file Type node contain 00 then in the table the product should be come like "Other"
if Type element value is
00 then "Other" like wise
51 = Business Loan – General
05 = Personal Loan
I want to see all product in alphabetical ascending odder.
This is my Input XML
<product>
<months>
<Type>00</Type>
<Number>2</Number>
</months>
<months>
<Type>51</Type>
<Number>2</Number>
</months>
<months>
<Type>05</Type>
<Number>1</Number>
</months>
</product>
I tried this Here
quantity
<fo:table>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block >Product Type</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Quantity</fo:block>
</fo:table-cell>
<xsl:for-each select=" Product/months">
<xsl:variable name="Variable" select="Type"></xsl:variable>
<fo:table-row>
<fo:table-cell>
<fo:block >
<xsl:choose>
<xsl:when test="Type[contains(text(),'05')]">
Personal Loan
</xsl:when>
<xsl:when test="ProductType[contains(text(),'55')]">
Business Loan – General
</xsl:when>
<xsl:when test="ProductType[contains(text(),'00')]">
Other
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Number"/>
</fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-body>
</fo:table>
I got the O/p like below
Product Type | Quantity
-----------------------------------------------------------
Other | 2
Business Loan – General | 2
Personal Loan | 1
but Actual Expected OUT/PUT is this
Product Type | Quantity
-----------------------------------------------------------
Business Loan – General | 2
Other | 2
Personal Loan | 1
If can use XSLT 2.0, you can create a variable to hold elements that represent your mappings
<xsl:variable name="products">
<map-entry key="05">Personal Loan</map-entry>
<map-entry key="51">Business Loan – General</map-entry>
<map-entry key="00">Other</map-entry>
</xsl:variable>
Then you can use a key to look these up by the key attribute
<xsl:key name="map" match="map-entry" use="#key" />
You would then use this key in a sort, like so:
<xsl:for-each select="product/months">
<xsl:sort select="key('map', Type, $products)" />
(As an aside, do make sure you use the correct case, as in your XSLT you were using Product, not product)
Try this XSLT, which you can see in action at http://xsltfiddle.liberty-development.net/pPzifoQ
<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="xs"
version="2.0">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="products">
<map-entry key="05">Personal Loan</map-entry>
<map-entry key="51">Business Loan – General</map-entry>
<map-entry key="00">Other</map-entry>
</xsl:variable>
<xsl:key name="map" match="map-entry" use="#key" />
<xsl:template match="/">
<fo:table>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Product Type</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Quantity</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="product/months">
<xsl:sort select="key('map', Type, $products)" />
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="key('map', Type, $products)" />
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Number"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
Note, if you can use XSLT 3.0, there is a dedicated "map" function you can use, which slightly simplifies things
Try this XSLT 3.0, which you can see in action at http://xsltfiddle.liberty-development.net/bnnZVx
<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="xs"
version="3.0">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="products" as="map(xs:string, xs:string)">
<xsl:map>
<xsl:map-entry key="'05'" select="'Personal Loan'"/>
<xsl:map-entry key="'51'" select="'Business Loan – General'"/>
<xsl:map-entry key="'00'" select="'Other'"/>
</xsl:map>
</xsl:variable>
<xsl:template match="/">
<fo:table>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>Product Type</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Quantity</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="product/months">
<xsl:sort select="$products(Type)" />
<fo:table-row>
<fo:table-cell>
<fo:block>
<xsl:value-of select="$products(Type)" />
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<xsl:value-of select="Number"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</xsl:template>
</xsl:stylesheet>
There are several ways you could look at this. For example, you could avoid sorting altogether - esp. if you only have 3 possible product types - by applying templates to each type in turn.
Here's a simplified example:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/product">
<table>
<tr>
<th>Product Type</th>
<th>Quantity</th>
</tr>
<xsl:apply-templates select="months[Type='51']"/>
<xsl:apply-templates select="months[Type='00']"/>
<xsl:apply-templates select="months[Type='05']"/>
</table>
</xsl:template>
<xsl:template match="months">
<tr>
<td>
<xsl:choose>
<xsl:when test="Type='51'">Business Loan – General</xsl:when>
<xsl:when test="Type='05'">Personal Loan</xsl:when>
<xsl:when test="Type='00'">Other</xsl:when>
</xsl:choose>
</td>
<td>
<xsl:value-of select="Number"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
Another option is to sort by custom order - again, using the codes in their intended order:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/product">
<table>
<tr>
<th>Product Type</th>
<th>Quantity</th>
</tr>
<xsl:variable name="sort-order">|51|00|05|</xsl:variable>
<xsl:for-each select="months">
<xsl:sort select="string-length(substring-before($sort-order, concat('|', Type, '|')))" data-type="number"/>
<tr>
<td>
<xsl:choose>
<xsl:when test="Type='51'">Business Loan – General</xsl:when>
<xsl:when test="Type='05'">Personal Loan</xsl:when>
<xsl:when test="Type='00'">Other</xsl:when>
</xsl:choose>
</td>
<td>
<xsl:value-of select="Number"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
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>
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:
can I use for-each-group if yes then can someone show me an example. I am trying to generate a pdf using xsl-fo
I am trying to output it using a table. Please show me an example which makes use of grouping technique and adding values. However, the output should be displayed in a table.
xml file:
<?xml version="1.0"?>
<Library>
<Book code="123">
<BookName>XML</BookName>
<Category>Programming</Category>
<Quantity>10</Quantity>
<Price>100</Price>
</Book>
<Book code="345">
<BookName>Photoshop</BookName>
<Category>Design</Category>
<Quantity>50</Quantity>
<Price>200</Price>
</Book>
<Book code="123">
<BookName>XML</BookName>
<Category>Programming</Category>
<Quantity>5</Quantity>
<Price>100</Price>
</Book>
<Book code="345">
<BookName>Photoshop</BookName>
<Category>Design</Category>
<Quantity>10</Quantity>
<Price>200</Price>
</Book>
<Book code="456">
<BookName>Illustrator</BookName>
<Category>Design</Category>
<Quantity>100</Quantity>
<Price>300</Price>
</Book>
</Library>
myxsl-fo
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:output encoding="UTF-8" indent="yes" method="xml" standalone="no" omit-xml-declaration="no"/>
<xsl:template match="Library">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4-landscape" page-height="300mm" page-width="150mm" margin="1in">
<fo:region-body margin="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4-landscape">
<fo:flow flow-name="xsl-region-body">
<fo:table border-top-style="solid" border-top-width="thick">
<fo:table-body font-size="12pt" font-family="times new roman">
<fo:table-row border-bottom-style="solid" border-bottom-color="#000" border-bottom-width="thick">
<fo:table-cell padding-top="1mm" padding-bottom="1mm">
<fo:block font-weight="bold">Category</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="1mm" padding-bottom="1mm">
<fo:block font-weight="bold">Book Code</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="1mm" padding-bottom="1mm">
<fo:block font-weight="bold">Quantity</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="1mm" padding-bottom="1mm">
<fo:block font-weight="bold">Price</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="1mm" padding-bottom="1mm">
<fo:block font-weight="bold">Total</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="Book">
<xsl:sort select="Category"/>
<xsl:sort select="#code"/>
<fo:table-row>
<fo:table-cell padding-top="3mm" padding-bottom="3mm">
<fo:block font-weight="bold">
<xsl:value-of select="Category"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="3mm" padding-bottom="3mm">
<fo:block font-weight="bold">
<xsl:value-of select="#code"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="3mm" padding-bottom="3mm">
<fo:block font-weight="bold">
<xsl:value-of select="Quantity"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="3mm" padding-bottom="3mm">
<fo:block font-weight="bold">
<xsl:value-of select="Price"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-top="3mm" padding-bottom="3mm">
<fo:block font-weight="bold">
<xsl:value-of select="number(Quantity)*number(Price)"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
Instead of xsl:for-each if I try to use xsl:for-each-group then it throws an error saying that the xsl:for-each-group cannot be in that location.
my current output:
however the output I want is shown in the image below:
thanks
As mentioned in the comments, if you are using XSLT 1.0 then the xsl:for-each-group command is not available. In XSLT 1.0, grouping is usually done using a technique called Muenchian Grouping. It is worth reading it, and understanding it, as it is a very useful technique in XSLT 1.0 once you understand it.
In Muenchian Grouping, you start off by defining a key which will be used to look up the elements in your group. In your case, you are grouping by Category and Code together, and so they key would look like this:
<xsl:key name="GroupByCategoryCode" match="Book" use="concat(Category, '|', #code)"/>
Now, in XSLT 2.0, you would probably write this...
<xsl:for-each-group select="Library/Book" group-by="concat(Category, '|', #code)">
However, in XSLT 1.0 you have to write this (I've added lots of indentation to improve readability)
<xsl:for-each
select="Library/Book
[
generate-id() =
generate-id
(
key('GroupByCategoryCode', concat(Category, '|', #code))[1]
)
]">
(Using xsl:apply-templates here would also work).
What this is going is looking at all Book elements, and checking its combination of "Category" and "Code" to see whether it is the first occurrence of that element in the key. Effectively it will pick the distinct occurences of "Category" and "Code".
In XSLT 2.0, you would use "current-group" to then iterate over all elements in the group. In XSLT 1.0, you would just use the key
<xsl:for-each select="key('GroupByCategoryCode', concat(Category, '|', #code))">
Although, in this particular case, you don't need to do a for-each, as you are just summing up Quantity in each group.
<xsl:value-of
select="sum(key('GroupByCategoryCode', concat(Category, '|', #code))/Quantity)"/>
Or, to improve readability abit...
<xsl:variable name="currentGroup" select="key('GroupByCategoryCode', concat(Category, '|', #code))"/>
<xsl:value-of select="sum($currentGroup/Quantity)"/>
Try this XSLT. To keep things simple (and because I don't know xsl-fo) I am outputting HTML to demonstrate the principle. All you need to do is to replace the HTML tags with their xsl-fo equivalents
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="GroupByCategoryCode" match="Book" use="concat(Category, '|', #code)"/>
<xsl:template match="/">
<html>
<body>
<h1>Books Information</h1>
<table border="1">
<tr>
<th>Category</th>
<th>Book Code</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Price</th>
</tr>
<xsl:apply-templates select="Library/Book[generate-id() = generate-id(key('GroupByCategoryCode', concat(Category, '|', #code))[1])]">
<xsl:sort select="Category"/>
<xsl:sort select="#code"/>
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="Book">
<xsl:variable name="currentGroup" select="key('GroupByCategoryCode', concat(Category, '|', #code))"/>
<tr>
<td>
<xsl:value-of select="Category"/>
</td>
<td>
<xsl:value-of select="#code"/>
</td>
<td>
<xsl:value-of select="sum($currentGroup/Quantity)"/>
</td>
<td>
<xsl:value-of select="Price"/>
</td>
<td>
<xsl:value-of select="sum($currentGroup/Quantity) * Price"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
EDIT: To show the word 'Repeated' instead of the Category for repeated categories, you could view this as grouping by category, and only show the category name for the first one in the group.
So, add the following key to the XSLT, to allow you to look up books by category
<xsl:key name="GroupByCategory" match="Book" use="Category"/>
Then, you need to pick the distinct categories (this should surround the existing xsl:apply-templates)
<xsl:for-each select="Library/Book[generate-id() = generate-id(key('GroupByCategory', Category)[1])]">
Then within the template matching Book you could then determine whether to show the category name or "defined" like so
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="Category" />
</xsl:when>
<xsl:otherwise>
<xsl:text>Repeated</xsl:text>
</xsl:otherwise>
</xsl:choose>
Try this XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="GroupByCategoryCode" match="Book" use="concat(Category, '|', #code)"/>
<xsl:key name="GroupByCategory" match="Book" use="Category"/>
<xsl:template match="/">
<html>
<body>
<h1>Books Information</h1>
<table border="1">
<tr>
<th>Category</th>
<th>Book Code</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Price</th>
</tr>
<xsl:for-each select="Library/Book[generate-id() = generate-id(key('GroupByCategory', Category)[1])]">
<xsl:sort select="Category"/>
<xsl:apply-templates select="key('GroupByCategory', Category)[generate-id() = generate-id(key('GroupByCategoryCode', concat(Category, '|', #code))[1])]">
<xsl:sort select="#code"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="Book">
<xsl:variable name="Category">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="Category" />
</xsl:when>
<xsl:otherwise>
<xsl:text>Repeated</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="currentGroup" select="key('GroupByCategoryCode', concat(Category, '|', #code))"/>
<tr>
<td>
<xsl:value-of select="$Category"/>
</td>
<td>
<xsl:value-of select="#code"/>
</td>
<td>
<xsl:value-of select="sum($currentGroup/Quantity)"/>
</td>
<td>
<xsl:value-of select="Price"/>
</td>
<td>
<xsl:value-of select="sum($currentGroup/Quantity) * Price"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
I've a need to display certain XML content in tabular form (XSL-FO for pdf reports),
and not all the columns to displayed are present in source XML. So, I was wondering
if there is a way to transform source XML by embedding additional columns based on
certain element values, and then process the resulting XML to display content?
As an example, for source data:
<projectteam>
<member>
<name>John Doe</name>
<role>dev</role>
<hrs>100</hrs>
</member>
<member>
<name>Paul Coder</name>
<role>dev</role>
<hrs>40</hrs>
</member>
<member>
<name>Henry Tester</name>
<role>qa</role>
<hrs>80</hrs>
</member>
<member>
<name>Peter Tester</name>
<role>qa</role>
<hrs>40</hrs>
</member>
</projectteam>
I'd like the data to be displayed as :
Name Role Dev QA
---------------------------
John Doe dev 100
Paul Coder dev 40
Henry Tester qa 80
Peter Tester qa 40
---------------------------
Role Totals: 140 120
---------------------------
I would like to know if I can use something like:
<xsl:element name="{role}">
<xsl:value-of select="member/hrs"/>
</xsl:element>
So that I can embed elements <dev>100</dev> and so on at run time during
first pass, and then use the resulting XML to display data for new columsn 'dev'
and 'qa', that way, calculating totals for each role type will be much simpler
(for eg. "sum(preceding-sibling::member/dev)" for dev column), and the data for each
cell in 'dev' and 'qa' colums could simply be the value-of these tags respectively.
It got the desired results the hard way using following stylesheet (page formatting
details omitted to keep it brief), but am not convinced that this is the apt solution.
...
<fo:table-body>
<!-- fills table rows -->
<xsl:apply-templates select="member"/>
<!-- dislpay totals for each role -->
<fo:table-row height="12pt" border-bottom="1pt solid black">
<fo:table-cell number-columns-spanned="2">
<fo:block>Role Totals:</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right">
<xsl:call-template name="RoleTotals">
<xsl:with-param name="node" select="//member[1]"/>
<xsl:with-param name="roleName" select="'dev'"/>
</xsl:call-template>
</fo:table-cell>
<fo:table-cell text-align="right">
<xsl:call-template name="RoleTotals">
<xsl:with-param name="node" select="//member[1]"/>
<xsl:with-param name="roleName" select="'qa'"/>
</xsl:call-template>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
...
</fo:root>
</xsl:template>
<xsl:template match="member">
<fo:table-row border-bottom="1pt solid black">
<fo:table-cell> <fo:block> <xsl:value-of select="name"/></fo:block></fo:table-cell>
<fo:table-cell> <fo:block> <xsl:value-of select="role"/></fo:block></fo:table-cell>
<fo:table-cell text-align="right">
<fo:block>
<xsl:if test="role = 'dev'"><xsl:value-of select="hrs"/></xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right">
<fo:block>
<xsl:if test="role = 'qa'"><xsl:value-of select="hrs"/></xsl:if>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template>
<xsl:template name="RoleTotals">
<xsl:param name="node"/>
<xsl:param name="roleName"/>
<xsl:param name="RT" select="0"/>
<xsl:variable name="newRT">
<xsl:choose>
<xsl:when test="$node/role = $roleName">
<xsl:value-of select="$RT + $node/hrs"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$RT"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$node/following-sibling::member">
<xsl:call-template name="RoleTotals">
<xsl:with-param name="node" select="$node/following-sibling::member[1]"/>
<xsl:with-param name="roleName" select="$roleName"/>
<xsl:with-param name="RT" select="$newRT"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<fo:block><xsl:value-of select="$newRT"/></fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
What would happen if more job roles, other than Dev and QA got added? Would your stylesheet be able to cope? Maybe you can make use of Muenchian Grouping to get all possible roles in the stylesheet, and then generate columns for each possible role dynamically?
<xsl:key name="roles" match="role" use="."/>
<xsl:template match="/projectteam">
<table border="1">
<tr>
<td>Name</td>
<td>Role</td>
<xsl:for-each select="member[generate-id(role) = generate-id(key('roles', role)[1])]">
<td>
<xsl:value-of select="role"/>
</td>
</xsl:for-each>
</tr>
<xsl:apply-templates select="member"/>
</table>
</xsl:template>
<xsl:template match="member">
<xsl:variable name="currentrole" select="role"/>
<xsl:variable name="currenthrs" select="hrs"/>
<tr>
<td>
<xsl:value-of select="name"/>
</td>
<td>
<xsl:value-of select="role"/>
</td>
<xsl:for-each select="/projectteam/member[generate-id(role) = generate-id(key('roles', role)[1])]">
<td>
<xsl:choose>
<xsl:when test="$currentrole = role">
<xsl:value-of select="$currenthrs"/>
</xsl:when>
</xsl:choose>
</td>
</xsl:for-each>
</tr>
</xsl:template>
I've outputted as HTML, not XSL-FO, but maybe this gives you the general idea.
Yes, you can.
To answer your question. I haven't read the huge stylesheet, to be true.