How do I get each office to print on a seperate page using XSLT?











up vote
0
down vote

favorite












I have the below xml and xslt.



All the data in the xml file prints on a single page.



Each office has personnel and fax machines associated with them.



I want each office (Office One, Office Two and Office Three) along with their associated personnel and faxes to each print on separate pages.



Thanks in advance for any help.



personnel_roster.xml



<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "personnel_roster.xslt"?>
<rows appMode="{appmode}" dateGenerated="11/05/2018">
<row OfficeID="32" OfficeOutputOrder="1" Office="O1" OfficeTitle="Office One" RoomFaxID="88" RoomFaxNumber="(555) 555-1212" RoomNumberID="120">
<personnel>
<person PersonnelID="360" Name="Employee Supervisor" PositionRoomNumberID="120" phone="(555) 637-5770" PAETitle="Dir, Head Office" PositionEmployeeTypeID="C" PositionOutputOrder="1" />
<person PersonnelID="850" Name="Employee One" PositionRoomNumberID="120" phone="(555) 694-7191" PAETitle="Principal Deputy Director" PositionEmployeeTypeID="C" PositionOutputOrder="2" />
<person PersonnelID="669" Name="Employee Two" PositionRoomNumberID="120" phone="(555) 554-0199" PAETitle="Senior Assistant" PositionEmployeeTypeID="M" PositionOutputOrder="11" />
<person PersonnelID="417" Name="Employee Three" PositionRoomNumberID="125" phone="(555) 336-4242" PAETitle="Special Assistant" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="470" Name="Employee Four" PositionRoomNumberID="125" phone="(555) 587-9046" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="474" Name="Employee Five" PositionRoomNumberID="125" phone="(555) 2270-8654" PAETitle="Special Assistant to the Director" PositionEmployeeTypeID="C" PositionOutputOrder="22" />
</personnel>
<officeFaxes>
<fax RoomNumberID="120" RoomFaxNumber="(555) 614-8413" OfficeID="32" />
</officeFaxes>
</row>
<row OfficeID="82" OfficeOutputOrder="5" Office="O2" OfficeTitle="Office Two" RoomFaxID="94" RoomFaxNumber="(555) 555-1213" RoomNumberID="121">
<personnel>
<person PersonnelID="582" Name="Employee Supervisor" PositionRoomNumberID="121" phone="(555) 693-7828" PAETitle="Director (O2)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="398" Name="Employee One" PositionRoomNumberID="126" phone="(555) 372-4329" PAETitle="T Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="338" Name="Employee Two" PositionRoomNumberID="121" phone="(555) 693-7825" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="368" Name="Employee Three" PositionRoomNumberID="121" phone="(555) 693-2086" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="365" Name="Employee Four" PositionRoomNumberID="121" phone="(555) 697-0223" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="375" Name="Employee Five" PositionRoomNumberID="121" phone="(555) 693-4141" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="797" Name="Employee Six" PositionRoomNumberID="121" phone="(555) 614-9271" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="356" Name="Employee Seven" PositionRoomNumberID="121" phone="(555) 697-0361" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="404" Name="Employee Eight" PositionRoomNumberID="126" phone="(555) 372-4331" PAETitle="manager" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4342" OfficeID="82" />
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4370" OfficeID="82" />
<fax RoomNumberID="126" RoomFaxNumber="(555) 614-8413" OfficeID="82" />
</officeFaxes>
</row>
<row OfficeID="76" OfficeOutputOrder="9" Office="O3" OfficeTitle="Office Three" RoomFaxID="95" RoomFaxNumber="(555) 555-1214" RoomNumberID="122">
<personnel>
<person PersonnelID="763" Name="Employee Supervisor" PositionRoomNumberID="122" phone="(555) 697-9189" PAETitle="Director (O3)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="471" Name="Employee One" PositionRoomNumberID="122" phone="(555) 695-7935" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="439" Name="Employee Two" PositionRoomNumberID="122" phone="(555) 614-3951" PAETitle="administrative Program Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="446" Name="Employee Three" PositionRoomNumberID="122" phone="(555) 256-0636" PAETitle="Security Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="456" Name="Employee Four" PositionRoomNumberID="122" phone="(555) 256-0603" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="436" Name="Employee Five" PositionRoomNumberID="122" phone="(555) 695-8225" PAETitle="Talent Management Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="729" Name="Employee Six" PositionRoomNumberID="122" phone="(555) 693-3038" PAETitle="Administrative Program Specialist (Facilities)" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="122" RoomFaxNumber="(555) 256-1412" OfficeID="76" />
</officeFaxes>
</row>
</rows>


personnel_roster.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="html" version="1.0" indent="no" omit-xml-declaration="yes" media-type="text/html"/>


<xsl:template match="/rows">

<div class="previewPrintReport">
<table id="art_report_output" class="tablesorter-blue execTable" cellpadding="1" cellspacing="0" width="100%" border="0">
<caption style="text-align:center;vertical-align:middle"><b>REPORT TITLE </b>
<xsl:choose>
<xsl:when test="@appMode='prod'"></xsl:when>
<xsl:otherwise> (<xsl:value-of select="@appMode"/>)</xsl:otherwise>
</xsl:choose>
generated on <xsl:value-of select="@dateGenerated"/>
</caption>
<thead>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">TELEPHONE ROSTER</th>
</tr>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">OFFICE OF THE DIRECTOR, COST ASSESSMENT PROGRAM EVALUATION</th>
</tr>
<tr>
<th width="25%"> </th>
<th width="30%"> </th>
<th width="15%">ROOM NO.</th>
<th width="30%">EXTENSION</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="row">

<xsl:variable name="officeName" select="@Office"/>
<xsl:variable name="officeTitle" select="@OfficeTitle"/>
<xsl:variable name="officeFaxRoom" select="@RoomNumberID"/>
<xsl:variable name="officeFax" select="@RoomFaxNumber"/>
<xsl:variable name ="officeFirst" select="/rows/row[1]/@Office"/>
<xsl:variable name ="officeLast" select="/rows/row[last()]/@Office"/>

<xsl:if test="personnel">
<page>
<xsl:element name="tr">
<td colspan="4"><hr style="background-color: #000000;" /></td>
</xsl:element>

<xsl:for-each select="personnel/person">
<xsl:choose>
<xsl:when test="position()=1">
<!-- Office Manager -->
<xsl:element name="tr">
<td>Director (<xsl:value-of select="$officeName"/>)<br/><xsl:value-of select="$officeTitle"/></td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>

<xsl:if test="officeFaxes">
<xsl:element name="tr">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</xsl:element>

<xsl:for-each select="officeFaxes/fax">
<xsl:choose>
<xsl:when test="position()=1 and $officeFax">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="$officeFaxRoom"/></td>
<td><xsl:value-of select="$officeFax"/></td>
</xsl:element>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:when test="position()=1">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</page>
<xsl:if test="$officeName=$officeFirst or $officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center; padding-top: 10px;"><span class="importantContactNumber">*** Call Center Support 555-555-1316 ***</span></td>
</xsl:element>
</xsl:if>

<xsl:if test="$officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center;">FOOTER FOR LAST OFFICE</td>
</xsl:element>
</xsl:if>

</xsl:if>
</xsl:for-each>
</tbody>

</table>
</div>
</xsl:template>

</xsl:stylesheet>









share|improve this question
























  • could you please include your desired output in html?
    – Joel M. Lamsen
    Nov 6 at 7:47










  • By " print on separate pages", do you mean you want separate HTML files for each office?
    – Hobbes
    Nov 6 at 8:42










  • You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
    – Tim C
    Nov 6 at 9:01















up vote
0
down vote

favorite












I have the below xml and xslt.



All the data in the xml file prints on a single page.



Each office has personnel and fax machines associated with them.



I want each office (Office One, Office Two and Office Three) along with their associated personnel and faxes to each print on separate pages.



Thanks in advance for any help.



personnel_roster.xml



<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "personnel_roster.xslt"?>
<rows appMode="{appmode}" dateGenerated="11/05/2018">
<row OfficeID="32" OfficeOutputOrder="1" Office="O1" OfficeTitle="Office One" RoomFaxID="88" RoomFaxNumber="(555) 555-1212" RoomNumberID="120">
<personnel>
<person PersonnelID="360" Name="Employee Supervisor" PositionRoomNumberID="120" phone="(555) 637-5770" PAETitle="Dir, Head Office" PositionEmployeeTypeID="C" PositionOutputOrder="1" />
<person PersonnelID="850" Name="Employee One" PositionRoomNumberID="120" phone="(555) 694-7191" PAETitle="Principal Deputy Director" PositionEmployeeTypeID="C" PositionOutputOrder="2" />
<person PersonnelID="669" Name="Employee Two" PositionRoomNumberID="120" phone="(555) 554-0199" PAETitle="Senior Assistant" PositionEmployeeTypeID="M" PositionOutputOrder="11" />
<person PersonnelID="417" Name="Employee Three" PositionRoomNumberID="125" phone="(555) 336-4242" PAETitle="Special Assistant" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="470" Name="Employee Four" PositionRoomNumberID="125" phone="(555) 587-9046" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="474" Name="Employee Five" PositionRoomNumberID="125" phone="(555) 2270-8654" PAETitle="Special Assistant to the Director" PositionEmployeeTypeID="C" PositionOutputOrder="22" />
</personnel>
<officeFaxes>
<fax RoomNumberID="120" RoomFaxNumber="(555) 614-8413" OfficeID="32" />
</officeFaxes>
</row>
<row OfficeID="82" OfficeOutputOrder="5" Office="O2" OfficeTitle="Office Two" RoomFaxID="94" RoomFaxNumber="(555) 555-1213" RoomNumberID="121">
<personnel>
<person PersonnelID="582" Name="Employee Supervisor" PositionRoomNumberID="121" phone="(555) 693-7828" PAETitle="Director (O2)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="398" Name="Employee One" PositionRoomNumberID="126" phone="(555) 372-4329" PAETitle="T Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="338" Name="Employee Two" PositionRoomNumberID="121" phone="(555) 693-7825" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="368" Name="Employee Three" PositionRoomNumberID="121" phone="(555) 693-2086" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="365" Name="Employee Four" PositionRoomNumberID="121" phone="(555) 697-0223" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="375" Name="Employee Five" PositionRoomNumberID="121" phone="(555) 693-4141" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="797" Name="Employee Six" PositionRoomNumberID="121" phone="(555) 614-9271" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="356" Name="Employee Seven" PositionRoomNumberID="121" phone="(555) 697-0361" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="404" Name="Employee Eight" PositionRoomNumberID="126" phone="(555) 372-4331" PAETitle="manager" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4342" OfficeID="82" />
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4370" OfficeID="82" />
<fax RoomNumberID="126" RoomFaxNumber="(555) 614-8413" OfficeID="82" />
</officeFaxes>
</row>
<row OfficeID="76" OfficeOutputOrder="9" Office="O3" OfficeTitle="Office Three" RoomFaxID="95" RoomFaxNumber="(555) 555-1214" RoomNumberID="122">
<personnel>
<person PersonnelID="763" Name="Employee Supervisor" PositionRoomNumberID="122" phone="(555) 697-9189" PAETitle="Director (O3)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="471" Name="Employee One" PositionRoomNumberID="122" phone="(555) 695-7935" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="439" Name="Employee Two" PositionRoomNumberID="122" phone="(555) 614-3951" PAETitle="administrative Program Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="446" Name="Employee Three" PositionRoomNumberID="122" phone="(555) 256-0636" PAETitle="Security Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="456" Name="Employee Four" PositionRoomNumberID="122" phone="(555) 256-0603" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="436" Name="Employee Five" PositionRoomNumberID="122" phone="(555) 695-8225" PAETitle="Talent Management Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="729" Name="Employee Six" PositionRoomNumberID="122" phone="(555) 693-3038" PAETitle="Administrative Program Specialist (Facilities)" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="122" RoomFaxNumber="(555) 256-1412" OfficeID="76" />
</officeFaxes>
</row>
</rows>


personnel_roster.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="html" version="1.0" indent="no" omit-xml-declaration="yes" media-type="text/html"/>


<xsl:template match="/rows">

<div class="previewPrintReport">
<table id="art_report_output" class="tablesorter-blue execTable" cellpadding="1" cellspacing="0" width="100%" border="0">
<caption style="text-align:center;vertical-align:middle"><b>REPORT TITLE </b>
<xsl:choose>
<xsl:when test="@appMode='prod'"></xsl:when>
<xsl:otherwise> (<xsl:value-of select="@appMode"/>)</xsl:otherwise>
</xsl:choose>
generated on <xsl:value-of select="@dateGenerated"/>
</caption>
<thead>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">TELEPHONE ROSTER</th>
</tr>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">OFFICE OF THE DIRECTOR, COST ASSESSMENT PROGRAM EVALUATION</th>
</tr>
<tr>
<th width="25%"> </th>
<th width="30%"> </th>
<th width="15%">ROOM NO.</th>
<th width="30%">EXTENSION</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="row">

<xsl:variable name="officeName" select="@Office"/>
<xsl:variable name="officeTitle" select="@OfficeTitle"/>
<xsl:variable name="officeFaxRoom" select="@RoomNumberID"/>
<xsl:variable name="officeFax" select="@RoomFaxNumber"/>
<xsl:variable name ="officeFirst" select="/rows/row[1]/@Office"/>
<xsl:variable name ="officeLast" select="/rows/row[last()]/@Office"/>

<xsl:if test="personnel">
<page>
<xsl:element name="tr">
<td colspan="4"><hr style="background-color: #000000;" /></td>
</xsl:element>

<xsl:for-each select="personnel/person">
<xsl:choose>
<xsl:when test="position()=1">
<!-- Office Manager -->
<xsl:element name="tr">
<td>Director (<xsl:value-of select="$officeName"/>)<br/><xsl:value-of select="$officeTitle"/></td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>

<xsl:if test="officeFaxes">
<xsl:element name="tr">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</xsl:element>

<xsl:for-each select="officeFaxes/fax">
<xsl:choose>
<xsl:when test="position()=1 and $officeFax">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="$officeFaxRoom"/></td>
<td><xsl:value-of select="$officeFax"/></td>
</xsl:element>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:when test="position()=1">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</page>
<xsl:if test="$officeName=$officeFirst or $officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center; padding-top: 10px;"><span class="importantContactNumber">*** Call Center Support 555-555-1316 ***</span></td>
</xsl:element>
</xsl:if>

<xsl:if test="$officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center;">FOOTER FOR LAST OFFICE</td>
</xsl:element>
</xsl:if>

</xsl:if>
</xsl:for-each>
</tbody>

</table>
</div>
</xsl:template>

</xsl:stylesheet>









share|improve this question
























  • could you please include your desired output in html?
    – Joel M. Lamsen
    Nov 6 at 7:47










  • By " print on separate pages", do you mean you want separate HTML files for each office?
    – Hobbes
    Nov 6 at 8:42










  • You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
    – Tim C
    Nov 6 at 9:01













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have the below xml and xslt.



All the data in the xml file prints on a single page.



Each office has personnel and fax machines associated with them.



I want each office (Office One, Office Two and Office Three) along with their associated personnel and faxes to each print on separate pages.



Thanks in advance for any help.



personnel_roster.xml



<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "personnel_roster.xslt"?>
<rows appMode="{appmode}" dateGenerated="11/05/2018">
<row OfficeID="32" OfficeOutputOrder="1" Office="O1" OfficeTitle="Office One" RoomFaxID="88" RoomFaxNumber="(555) 555-1212" RoomNumberID="120">
<personnel>
<person PersonnelID="360" Name="Employee Supervisor" PositionRoomNumberID="120" phone="(555) 637-5770" PAETitle="Dir, Head Office" PositionEmployeeTypeID="C" PositionOutputOrder="1" />
<person PersonnelID="850" Name="Employee One" PositionRoomNumberID="120" phone="(555) 694-7191" PAETitle="Principal Deputy Director" PositionEmployeeTypeID="C" PositionOutputOrder="2" />
<person PersonnelID="669" Name="Employee Two" PositionRoomNumberID="120" phone="(555) 554-0199" PAETitle="Senior Assistant" PositionEmployeeTypeID="M" PositionOutputOrder="11" />
<person PersonnelID="417" Name="Employee Three" PositionRoomNumberID="125" phone="(555) 336-4242" PAETitle="Special Assistant" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="470" Name="Employee Four" PositionRoomNumberID="125" phone="(555) 587-9046" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="474" Name="Employee Five" PositionRoomNumberID="125" phone="(555) 2270-8654" PAETitle="Special Assistant to the Director" PositionEmployeeTypeID="C" PositionOutputOrder="22" />
</personnel>
<officeFaxes>
<fax RoomNumberID="120" RoomFaxNumber="(555) 614-8413" OfficeID="32" />
</officeFaxes>
</row>
<row OfficeID="82" OfficeOutputOrder="5" Office="O2" OfficeTitle="Office Two" RoomFaxID="94" RoomFaxNumber="(555) 555-1213" RoomNumberID="121">
<personnel>
<person PersonnelID="582" Name="Employee Supervisor" PositionRoomNumberID="121" phone="(555) 693-7828" PAETitle="Director (O2)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="398" Name="Employee One" PositionRoomNumberID="126" phone="(555) 372-4329" PAETitle="T Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="338" Name="Employee Two" PositionRoomNumberID="121" phone="(555) 693-7825" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="368" Name="Employee Three" PositionRoomNumberID="121" phone="(555) 693-2086" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="365" Name="Employee Four" PositionRoomNumberID="121" phone="(555) 697-0223" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="375" Name="Employee Five" PositionRoomNumberID="121" phone="(555) 693-4141" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="797" Name="Employee Six" PositionRoomNumberID="121" phone="(555) 614-9271" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="356" Name="Employee Seven" PositionRoomNumberID="121" phone="(555) 697-0361" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="404" Name="Employee Eight" PositionRoomNumberID="126" phone="(555) 372-4331" PAETitle="manager" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4342" OfficeID="82" />
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4370" OfficeID="82" />
<fax RoomNumberID="126" RoomFaxNumber="(555) 614-8413" OfficeID="82" />
</officeFaxes>
</row>
<row OfficeID="76" OfficeOutputOrder="9" Office="O3" OfficeTitle="Office Three" RoomFaxID="95" RoomFaxNumber="(555) 555-1214" RoomNumberID="122">
<personnel>
<person PersonnelID="763" Name="Employee Supervisor" PositionRoomNumberID="122" phone="(555) 697-9189" PAETitle="Director (O3)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="471" Name="Employee One" PositionRoomNumberID="122" phone="(555) 695-7935" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="439" Name="Employee Two" PositionRoomNumberID="122" phone="(555) 614-3951" PAETitle="administrative Program Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="446" Name="Employee Three" PositionRoomNumberID="122" phone="(555) 256-0636" PAETitle="Security Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="456" Name="Employee Four" PositionRoomNumberID="122" phone="(555) 256-0603" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="436" Name="Employee Five" PositionRoomNumberID="122" phone="(555) 695-8225" PAETitle="Talent Management Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="729" Name="Employee Six" PositionRoomNumberID="122" phone="(555) 693-3038" PAETitle="Administrative Program Specialist (Facilities)" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="122" RoomFaxNumber="(555) 256-1412" OfficeID="76" />
</officeFaxes>
</row>
</rows>


personnel_roster.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="html" version="1.0" indent="no" omit-xml-declaration="yes" media-type="text/html"/>


<xsl:template match="/rows">

<div class="previewPrintReport">
<table id="art_report_output" class="tablesorter-blue execTable" cellpadding="1" cellspacing="0" width="100%" border="0">
<caption style="text-align:center;vertical-align:middle"><b>REPORT TITLE </b>
<xsl:choose>
<xsl:when test="@appMode='prod'"></xsl:when>
<xsl:otherwise> (<xsl:value-of select="@appMode"/>)</xsl:otherwise>
</xsl:choose>
generated on <xsl:value-of select="@dateGenerated"/>
</caption>
<thead>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">TELEPHONE ROSTER</th>
</tr>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">OFFICE OF THE DIRECTOR, COST ASSESSMENT PROGRAM EVALUATION</th>
</tr>
<tr>
<th width="25%"> </th>
<th width="30%"> </th>
<th width="15%">ROOM NO.</th>
<th width="30%">EXTENSION</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="row">

<xsl:variable name="officeName" select="@Office"/>
<xsl:variable name="officeTitle" select="@OfficeTitle"/>
<xsl:variable name="officeFaxRoom" select="@RoomNumberID"/>
<xsl:variable name="officeFax" select="@RoomFaxNumber"/>
<xsl:variable name ="officeFirst" select="/rows/row[1]/@Office"/>
<xsl:variable name ="officeLast" select="/rows/row[last()]/@Office"/>

<xsl:if test="personnel">
<page>
<xsl:element name="tr">
<td colspan="4"><hr style="background-color: #000000;" /></td>
</xsl:element>

<xsl:for-each select="personnel/person">
<xsl:choose>
<xsl:when test="position()=1">
<!-- Office Manager -->
<xsl:element name="tr">
<td>Director (<xsl:value-of select="$officeName"/>)<br/><xsl:value-of select="$officeTitle"/></td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>

<xsl:if test="officeFaxes">
<xsl:element name="tr">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</xsl:element>

<xsl:for-each select="officeFaxes/fax">
<xsl:choose>
<xsl:when test="position()=1 and $officeFax">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="$officeFaxRoom"/></td>
<td><xsl:value-of select="$officeFax"/></td>
</xsl:element>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:when test="position()=1">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</page>
<xsl:if test="$officeName=$officeFirst or $officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center; padding-top: 10px;"><span class="importantContactNumber">*** Call Center Support 555-555-1316 ***</span></td>
</xsl:element>
</xsl:if>

<xsl:if test="$officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center;">FOOTER FOR LAST OFFICE</td>
</xsl:element>
</xsl:if>

</xsl:if>
</xsl:for-each>
</tbody>

</table>
</div>
</xsl:template>

</xsl:stylesheet>









share|improve this question















I have the below xml and xslt.



All the data in the xml file prints on a single page.



Each office has personnel and fax machines associated with them.



I want each office (Office One, Office Two and Office Three) along with their associated personnel and faxes to each print on separate pages.



Thanks in advance for any help.



personnel_roster.xml



<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "personnel_roster.xslt"?>
<rows appMode="{appmode}" dateGenerated="11/05/2018">
<row OfficeID="32" OfficeOutputOrder="1" Office="O1" OfficeTitle="Office One" RoomFaxID="88" RoomFaxNumber="(555) 555-1212" RoomNumberID="120">
<personnel>
<person PersonnelID="360" Name="Employee Supervisor" PositionRoomNumberID="120" phone="(555) 637-5770" PAETitle="Dir, Head Office" PositionEmployeeTypeID="C" PositionOutputOrder="1" />
<person PersonnelID="850" Name="Employee One" PositionRoomNumberID="120" phone="(555) 694-7191" PAETitle="Principal Deputy Director" PositionEmployeeTypeID="C" PositionOutputOrder="2" />
<person PersonnelID="669" Name="Employee Two" PositionRoomNumberID="120" phone="(555) 554-0199" PAETitle="Senior Assistant" PositionEmployeeTypeID="M" PositionOutputOrder="11" />
<person PersonnelID="417" Name="Employee Three" PositionRoomNumberID="125" phone="(555) 336-4242" PAETitle="Special Assistant" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="470" Name="Employee Four" PositionRoomNumberID="125" phone="(555) 587-9046" PositionEmployeeTypeID="C" PositionOutputOrder="21" />
<person PersonnelID="474" Name="Employee Five" PositionRoomNumberID="125" phone="(555) 2270-8654" PAETitle="Special Assistant to the Director" PositionEmployeeTypeID="C" PositionOutputOrder="22" />
</personnel>
<officeFaxes>
<fax RoomNumberID="120" RoomFaxNumber="(555) 614-8413" OfficeID="32" />
</officeFaxes>
</row>
<row OfficeID="82" OfficeOutputOrder="5" Office="O2" OfficeTitle="Office Two" RoomFaxID="94" RoomFaxNumber="(555) 555-1213" RoomNumberID="121">
<personnel>
<person PersonnelID="582" Name="Employee Supervisor" PositionRoomNumberID="121" phone="(555) 693-7828" PAETitle="Director (O2)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="398" Name="Employee One" PositionRoomNumberID="126" phone="(555) 372-4329" PAETitle="T Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="338" Name="Employee Two" PositionRoomNumberID="121" phone="(555) 693-7825" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="368" Name="Employee Three" PositionRoomNumberID="121" phone="(555) 693-2086" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="365" Name="Employee Four" PositionRoomNumberID="121" phone="(555) 697-0223" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="375" Name="Employee Five" PositionRoomNumberID="121" phone="(555) 693-4141" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="797" Name="Employee Six" PositionRoomNumberID="121" phone="(555) 614-9271" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="356" Name="Employee Seven" PositionRoomNumberID="121" phone="(555) 697-0361" PAETitle="Operations Research Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="404" Name="Employee Eight" PositionRoomNumberID="126" phone="(555) 372-4331" PAETitle="manager" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4342" OfficeID="82" />
<fax RoomNumberID="121" RoomFaxNumber="(555) 372-4370" OfficeID="82" />
<fax RoomNumberID="126" RoomFaxNumber="(555) 614-8413" OfficeID="82" />
</officeFaxes>
</row>
<row OfficeID="76" OfficeOutputOrder="9" Office="O3" OfficeTitle="Office Three" RoomFaxID="95" RoomFaxNumber="(555) 555-1214" RoomNumberID="122">
<personnel>
<person PersonnelID="763" Name="Employee Supervisor" PositionRoomNumberID="122" phone="(555) 697-9189" PAETitle="Director (O3)" PositionEmployeeTypeID="C" PositionOutputOrder="4" />
<person PersonnelID="471" Name="Employee One" PositionRoomNumberID="122" phone="(555) 695-7935" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="439" Name="Employee Two" PositionRoomNumberID="122" phone="(555) 614-3951" PAETitle="administrative Program Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="446" Name="Employee Three" PositionRoomNumberID="122" phone="(555) 256-0636" PAETitle="Security Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="456" Name="Employee Four" PositionRoomNumberID="122" phone="(555) 256-0603" PAETitle="Management and Program Analyst" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="436" Name="Employee Five" PositionRoomNumberID="122" phone="(555) 695-8225" PAETitle="Talent Management Specialist" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
<person PersonnelID="729" Name="Employee Six" PositionRoomNumberID="122" phone="(555) 693-3038" PAETitle="Administrative Program Specialist (Facilities)" PositionEmployeeTypeID="C" PositionOutputOrder="20" />
</personnel>
<officeFaxes>
<fax RoomNumberID="122" RoomFaxNumber="(555) 256-1412" OfficeID="76" />
</officeFaxes>
</row>
</rows>


personnel_roster.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="html" version="1.0" indent="no" omit-xml-declaration="yes" media-type="text/html"/>


<xsl:template match="/rows">

<div class="previewPrintReport">
<table id="art_report_output" class="tablesorter-blue execTable" cellpadding="1" cellspacing="0" width="100%" border="0">
<caption style="text-align:center;vertical-align:middle"><b>REPORT TITLE </b>
<xsl:choose>
<xsl:when test="@appMode='prod'"></xsl:when>
<xsl:otherwise> (<xsl:value-of select="@appMode"/>)</xsl:otherwise>
</xsl:choose>
generated on <xsl:value-of select="@dateGenerated"/>
</caption>
<thead>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">TELEPHONE ROSTER</th>
</tr>
<tr>
<th colspan="4" style="text-decoration: underline; text-align: center;">OFFICE OF THE DIRECTOR, COST ASSESSMENT PROGRAM EVALUATION</th>
</tr>
<tr>
<th width="25%"> </th>
<th width="30%"> </th>
<th width="15%">ROOM NO.</th>
<th width="30%">EXTENSION</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="row">

<xsl:variable name="officeName" select="@Office"/>
<xsl:variable name="officeTitle" select="@OfficeTitle"/>
<xsl:variable name="officeFaxRoom" select="@RoomNumberID"/>
<xsl:variable name="officeFax" select="@RoomFaxNumber"/>
<xsl:variable name ="officeFirst" select="/rows/row[1]/@Office"/>
<xsl:variable name ="officeLast" select="/rows/row[last()]/@Office"/>

<xsl:if test="personnel">
<page>
<xsl:element name="tr">
<td colspan="4"><hr style="background-color: #000000;" /></td>
</xsl:element>

<xsl:for-each select="personnel/person">
<xsl:choose>
<xsl:when test="position()=1">
<!-- Office Manager -->
<xsl:element name="tr">
<td>Director (<xsl:value-of select="$officeName"/>)<br/><xsl:value-of select="$officeTitle"/></td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td><xsl:value-of select="@Name"/></td>
<td><xsl:value-of select="@PositionRoomNumberID"/></td>
<td><xsl:value-of select="@phone"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>

<xsl:if test="officeFaxes">
<xsl:element name="tr">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</xsl:element>

<xsl:for-each select="officeFaxes/fax">
<xsl:choose>
<xsl:when test="position()=1 and $officeFax">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="$officeFaxRoom"/></td>
<td><xsl:value-of select="$officeFax"/></td>
</xsl:element>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:when test="position()=1">
<xsl:element name="tr">
<td> </td>
<td>Fax Line:</td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="tr">
<td> </td>
<td> </td>
<td><xsl:value-of select="@RoomNumberID"/></td>
<td><xsl:value-of select="@RoomFaxNumber"/></td>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</page>
<xsl:if test="$officeName=$officeFirst or $officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center; padding-top: 10px;"><span class="importantContactNumber">*** Call Center Support 555-555-1316 ***</span></td>
</xsl:element>
</xsl:if>

<xsl:if test="$officeName=$officeLast">
<xsl:element name="tr">
<td colspan="4" style="text-align: center;">FOOTER FOR LAST OFFICE</td>
</xsl:element>
</xsl:if>

</xsl:if>
</xsl:for-each>
</tbody>

</table>
</div>
</xsl:template>

</xsl:stylesheet>






xml xslt






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 5 at 19:02

























asked Nov 5 at 18:05









George

365




365












  • could you please include your desired output in html?
    – Joel M. Lamsen
    Nov 6 at 7:47










  • By " print on separate pages", do you mean you want separate HTML files for each office?
    – Hobbes
    Nov 6 at 8:42










  • You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
    – Tim C
    Nov 6 at 9:01


















  • could you please include your desired output in html?
    – Joel M. Lamsen
    Nov 6 at 7:47










  • By " print on separate pages", do you mean you want separate HTML files for each office?
    – Hobbes
    Nov 6 at 8:42










  • You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
    – Tim C
    Nov 6 at 9:01
















could you please include your desired output in html?
– Joel M. Lamsen
Nov 6 at 7:47




could you please include your desired output in html?
– Joel M. Lamsen
Nov 6 at 7:47












By " print on separate pages", do you mean you want separate HTML files for each office?
– Hobbes
Nov 6 at 8:42




By " print on separate pages", do you mean you want separate HTML files for each office?
– Hobbes
Nov 6 at 8:42












You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
– Tim C
Nov 6 at 9:01




You probably want to render a separate table for each office, and then use the css property "page-break-before" to specify a page break when printing.
– Tim C
Nov 6 at 9:01












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I found a css solution, I gave the row with my separator at the end of each office the following inline style.



<tr style="page-break-after: always;">





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53159840%2fhow-do-i-get-each-office-to-print-on-a-seperate-page-using-xslt%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I found a css solution, I gave the row with my separator at the end of each office the following inline style.



    <tr style="page-break-after: always;">





    share|improve this answer

























      up vote
      0
      down vote













      I found a css solution, I gave the row with my separator at the end of each office the following inline style.



      <tr style="page-break-after: always;">





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I found a css solution, I gave the row with my separator at the end of each office the following inline style.



        <tr style="page-break-after: always;">





        share|improve this answer












        I found a css solution, I gave the row with my separator at the end of each office the following inline style.



        <tr style="page-break-after: always;">






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 6 at 15:47









        George

        365




        365






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53159840%2fhow-do-i-get-each-office-to-print-on-a-seperate-page-using-xslt%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            這個網誌中的熱門文章

            Hercules Kyvelos

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud