I have to produce a report where the static content on each page is
dependant on the context.
Refering to the XML structure below:
Each TemplateCategory must start on a new page. The static content for that
page and the subsequent pages for the TemplateCategory flow content must
contain the information in the CommonPageHeader and TemplateCategoryHeader
for that TemplateCategory. To display the static information the
TemplateColumn and ScoresSectionHeading elements must be counted and
displayed.
The flow content consists of the Subjects and TemplateRowPoints.numbers.
I can't get the static content to contain only the data from the current
TemplateCategory, it always counts and displays the TemplateColumn and
ScoresSectionHeading elements from the whole document.
Refering to the sample XML the header on the first page should contain
ESSENTIAL and columns with Takes Initiative, Judgement, Suitability,
Performance and Overall followed by the flow content for 'test, two', 'test,
five', and 'test, eleven' within the ESSENTIAL category.
Then a page break and a header containing DESIRABLE and columns for
Optimistic, Influencing, Pressure Tolerance Suitability, Performance and
Overall followed by the flow content for 'test, two', 'test, five', and
'test, eleven' within the DESIRABLE category.
How can I get the static area to contain only the data relevant to the
current TemplateCategory?
How do I get the flow area to have a page break at the end of each
TemplateCategory? When the existing XSL below is applied the flow content
includes the data from both TemplateCategories without a page break between
them.
I feel I'm missing something very fundamental here but have been unable to
find an answer. I can change the structure of the XML if needed to obtain
the desired output structure.
Any help would be greatly appreciated
Regards,
Don
-------------------------- XSL ------------------------------
<fo:page-sequence master-name="basicPSM">
<!-- ================================================= -->
<!-- Setup header Details -->
<!-- ================================================= -->
<fo:static-content flow-name="xsl-region-before">
<fo:block>
<xsl:apply-templates select="CommonPageHeader"/>
<xsl:call-template name="PageHeaderDetail"/>
</fo:block>
</fo:static-content>
<!-- ================================================= -->
<!-- Calls content template -->
<!-- ================================================= -->
<fo:flow flow-name="xsl-region-body">
<fo:block>
<xsl:call-template name="ReportContent"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
<xsl:template name="PageHeaderDetail">
<fo:table
<!-- Fixed blank column -->
<fo:table-column
column-width="{$NameColWidth}pt"
border-color="black"
border-style="solid"
border-width=".5pt"/>
<!-- Create the columns for the trait score -->
<fo:table-column
column-width="{$ColWidth *
count(TemplateColumnCategoryPageHeader/ColumnHeader/TemplateColumn) }pt"
border-color="black"
border-style="solid"
border-width=".5pt"/>
<!-- Create the columns for the scores -->
<fo:table-column
column-width="{$ColWidth *
count(TemplateColumnCategoryPageHeader/ScoresSection/ScoresSectionHeading)
}pt"
border-color="black"
border-style="solid"
border-width=".5pt"/>
<!-- Create the Trait description cells -->
<fo:table-body
<fo:table-row>
<fo:table-cell/>
<xsl:for-each select= "TemplateColumnCategoryPageHeader/ColumnHeader">
<xsl:call-template name="OutputCell">
<xsl:with-param name="content" select="TemplateColumnCategory.name"/>
</xsl:call-template>
</xsl:for-each>
<xsl:call-template name="OutputCell">
<xsl:with-param name="content"
select="TemplateColumnCategoryPageHeader/ScoresSection/ScoresSection.label"/>
</xsl:call-template>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
<!-- Start of Report Content -->
<!-- ========================================================== -->
<xsl:template name="ReportContent">
<fo:table
background-color="#c6eff7"
space-before="0pt">
<!-- ================================================== -->
<!-- Create a column for the Profilee name -->
<!-- ================================================== -->
<fo:table-column
column-width="{$NameColWidth}pt"
border-color="black"
border-style="solid"
border-width=".5pt"/>
<!-- ================================================== -->
<!-- Create the columns for the scores -->
<!-- ================================================== -->
<xsl:apply-templates
select="TemplateColumnCategoryPageHeader/ColumnHeader"/>
<xsl:apply-templates
select="TemplateColumnCategoryPageHeader/ScoresSection"/>
<!-- ================================================== -->
<!-- Create the table body and add the Profilee's -->
<!-- ================================================== -->
<fo:table-body
<xsl:apply-templates select="TemplateColumnCategory/Subject" />
</fo:table-body>
</fo:table>
<fo:block break-after="page" />
<fo:block space-after="5mm" />
</xsl:template>
-------------------- the structure of the XML is
-----------------------------------
<DataStructure>
<CommonPageHeader/>
<TemplateCategory>
<TemplateCategoryPageHeader>
<ColumnHeader>
<TemplateColumn/>
</ColumnHeader>
<ScoresSection>
<ScoresSectionHeading/>
</ScoresSection>
</TemplateCategoryPageHeader>
<Subject>
<TemplateRowPoints.number/>
</Subject>
</TemplateCategory>
<DataStructure>
----------------------------------- example XML with content
------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DataStructure>
<DataStructure>
<CommonPageHeader>
<Document.title>GROUP REPORT</Document.title>
<Client.nameLabel>For</Client.nameLabel>
<Client.name>DBBClient</Client.name>
<Document.report.date>11/04/03</Document.report.date>
</CommonPageHeader>
<TemplateCategory>
<TemplateCategoryPageHeader>
<ColumnHeader>
<TemplateCategory.name>ESSENTIAL</TemplateCategory.name>
<TemplateColumn>
<ProfileFactor.name>Takes Initiative</ProfileFactor.name>
<TemplateColumnMaxPoints.number>140</TemplateColumnMaxPoints.number>
</TemplateColumn>
<TemplateColumn>
<ProfileFactor.name>Judgment (strategic)</ProfileFactor.name>
<TemplateColumnMaxPoints.number>130</TemplateColumnMaxPoints.number>
</TemplateColumn>
</ColumnHeader>
<ScoresSection>
<ScoresSection.label>Scores</ScoresSection.label>
<ScoresSectionHeading>HA Suitability</ScoresSectionHeading>
<ScoresSectionHeading>Performance</ScoresSectionHeading>
<ScoresSectionHeading>Overall</ScoresSectionHeading>
</ScoresSection>
<MaxPointsLabel>Max</MaxPointsLabel>
</TemplateCategoryPageHeader>
<Subject>
<Profilee.name>test, two</Profilee.name>
<TemplateRowPoints.number>121</TemplateRowPoints.number>
<TemplateRowPoints.number>98</TemplateRowPoints.number>
<Profilee.probabilityRating>67</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>67</Subject.totalSuitability>
</Subject>
<Subject>
<Profilee.name>test, five</Profilee.name>
<TemplateRowPoints.number>30</TemplateRowPoints.number>
<TemplateRowPoints.number>111</TemplateRowPoints.number>
<Profilee.probabilityRating>64</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>64</Subject.totalSuitability>
</Subject>
<Subject>
<Profilee.name>test, eleven</Profilee.name>
<TemplateRowPoints.number>107</TemplateRowPoints.number>
<TemplateRowPoints.number>87</TemplateRowPoints.number>
<Profilee.probabilityRating>60</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>60</Subject.totalSuitability>
</Subject>
</TemplateCategory>
<TemplateCategory>
<TemplateCategoryPageHeader>
<ColumnHeader>
<TemplateCategory.name>DESIRABLE</TemplateCategory.name>
<TemplateColumn>
<ProfileFactor.name>Optimistic</ProfileFactor.name>
<TemplateColumnMaxPoints.number>-220</TemplateColumnMaxPoints.number>
</TemplateColumn>
<TemplateColumn>
<ProfileFactor.name>Influencing</ProfileFactor.name>
<TemplateColumnMaxPoints.number>-170</TemplateColumnMaxPoints.number>
</TemplateColumn>
<TemplateColumn>
<ProfileFactor.name>Pressure Tolerance</ProfileFactor.name>
<TemplateColumnMaxPoints.number>-150</TemplateColumnMaxPoints.number>
</TemplateColumn>
<TemplateColumn>
</ColumnHeader>
<ScoresSection>
<ScoresSection.label>Scores</ScoresSection.label>
<ScoresSectionHeading>HA Suitability</ScoresSectionHeading>
<ScoresSectionHeading>Performance</ScoresSectionHeading>
<ScoresSectionHeading>Overall</ScoresSectionHeading>
</ScoresSection>
<MaxPointsLabel>Max</MaxPointsLabel>
</TemplateCategoryPageHeader>
<Subject>
<Profilee.name>test, two</Profilee.name>
<TemplateRowPoints.number>-7</TemplateRowPoints.number>
<TemplateRowPoints.number>-9</TemplateRowPoints.number>
<TemplateRowPoints.number>0</TemplateRowPoints.number>
<Profilee.probabilityRating>67</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>67</Subject.totalSuitability>
</Subject>
<Subject>
<Profilee.name>test, five</Profilee.name>
<TemplateRowPoints.number>-0</TemplateRowPoints.number>
<TemplateRowPoints.number>0</TemplateRowPoints.number>
<TemplateRowPoints.number>0</TemplateRowPoints.number>
<Profilee.probabilityRating>64</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>64</Subject.totalSuitability>
</Subject>
<Subject>
<Profilee.name>test, eleven</Profilee.name>
<TemplateRowPoints.number>0</TemplateRowPoints.number>
<TemplateRowPoints.number>-3</TemplateRowPoints.number>
<TemplateRowPoints.number>0</TemplateRowPoints.number>
<Profilee.probabilityRating>60</Profilee.probabilityRating>
<Profilee.performanceRating>0</Profilee.performanceRating>
<Subject.totalSuitability>60</Subject.totalSuitability>
</Subject>
</TemplateCategory>
</DataStructure>
_________________________________________________________________
Hot chart ringtones and polyphonics. Go to
http://ninemsn.com.au/mobilemania/default.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list