One page in landscape while others in Portrait in generating PDF using XSLT
<p>I am generating a PDF using following XSLT:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:template match="/"&gt;
        &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family = "Helvetica" font-size = "10px"&gt;
            &lt;fo:layout-master-set&gt;
                &lt;fo:simple-page-master margin-bottom="0.5cm" margin-left="0.75cm" margin-right="0.75cm" margin-top="0.5cm" master-name="first" page-height="27.9cm" page-width="21.6cm"&gt;
                    &lt;fo:region-body margin-bottom = "0.5cm" margin-top = "0.25cm"/&gt;
                    &lt;fo:region-before extent = "0cm"/&gt;
                    &lt;fo:region-after extent = "0.5cm"/&gt;
                &lt;/fo:simple-page-master&gt;
            &lt;/fo:layout-master-set&gt;
            &lt;xsl:for-each select="Rowsets"&gt;
                &lt;fo:page-sequence master-reference="first"&gt;
                    &lt;fo:static-content flow-name="xsl-region-before"&gt;
                        &lt;fo:block font-size="9pt" line-height="3pt" text-align-last="justify"&gt;

                        &lt;/fo:block&gt;
                    &lt;/fo:static-content&gt;
                    &lt;fo:static-content flow-name="xsl-region-after"&gt;
                        &lt;fo:block font-size="8pt" line-height="6pt" text-align-last="justify"&gt;
                            Report
                            &lt;fo:inline id="Date"&gt;
                                Date [currentDate]
                            &lt;/fo:inline&gt;
                            &lt;fo:leader leader-pattern = "space"/&gt;
                            Page
                            &lt;fo:page-number/&gt;
                        &lt;/fo:block&gt;
                    &lt;/fo:static-content&gt;
                    &lt;fo:flow flow-name="xsl-region-body"&gt;
                        &lt;xsl:for-each select="Rowset"&gt;
                            &lt;xsl:choose&gt;
                                &lt;xsl:when test="position()=25"&gt;
                                    &lt;fo:table border-color="black" border-style="solid" border-width="1pt" table-layout="fixed" width="100%"&gt;
                                        &lt;xsl:variable name="columns"&gt;
                                            &lt;xsl:value-of select="count(Columns/Column)" /&gt;
                                        &lt;/xsl:variable&gt;
                                        &lt;xsl:for-each select="Columns/Column"&gt;
                                            &lt;xsl:choose&gt;
                                                &lt;xsl:when test="position()=1"&gt;
                                                    &lt;fo:table-column column-width="30pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=2"&gt;
                                                    &lt;fo:table-column column-width="55pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=3"&gt;
                                                    &lt;fo:table-column column-width="32pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=5"&gt;
                                                    &lt;fo:table-column column-width="35pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=4"&gt;
                                                    &lt;fo:table-column column-width="60pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=8"&gt;
                                                    &lt;fo:table-column column-width="40pt"/&gt;
                                                &lt;/xsl:when&gt;

                                                &lt;xsl:when test="position()=12"&gt;
                                                    &lt;fo:table-column column-width="100pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:otherwise&gt;
                                                    &lt;fo:table-column/&gt;
                                                &lt;/xsl:otherwise&gt;
                                            &lt;/xsl:choose&gt;
                                        &lt;/xsl:for-each&gt;
                                        &lt;fo:table-body font-size="10pt"&gt;
                                            &lt;fo:table-row height="13pt"&gt;
                                                &lt;fo:table-cell background-color="#000000" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt" number-columns-spanned="{$columns}"&gt;
                                                    &lt;fo:block font-weight="bold" text-align="center" color="#FFFFFF"&gt;
                                                        &lt;xsl:value-of select="Columns/Column[1]/@Description" /&gt;
                                                    &lt;/fo:block&gt;
                                                &lt;/fo:table-cell&gt;
                                            &lt;/fo:table-row&gt;
                                            &lt;xsl:if test="Columns/Column[2]/@Description='true'"&gt;
                                                &lt;fo:table-row height="13pt"&gt;
                                                    &lt;xsl:for-each select="Columns/Column"&gt;
                                                        &lt;fo:table-cell background-color="#CCCCCC" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                            &lt;fo:block font-weight="bold" text-align="left"&gt;
                                                                &lt;xsl:value-of select="translate(@Name,'_',' ')" /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-row&gt;
                                            &lt;/xsl:if&gt;
                                            &lt;xsl:for-each select="Row"&gt;
                                                &lt;fo:table-row height="13pt"&gt;
                                                    &lt;xsl:for-each select="child::*"&gt;
                                                        &lt;fo:table-cell background-color="#FFFFFF" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                            &lt;fo:block font-weight="normal" text-align="left"&gt;
                                                                &lt;xsl:value-of select="." /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-row&gt;
                                            &lt;/xsl:for-each&gt;
                                        &lt;/fo:table-body&gt;
                                    &lt;/fo:table&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:otherwise&gt;
                                    &lt;xsl:choose&gt;
                                        &lt;xsl:when test="Columns/Column[1]/@Description = 'Break'"&gt;
                                            &lt;fo:block page-break-before="always" /&gt;
                                        &lt;/xsl:when&gt;
                                        &lt;xsl:otherwise&gt;
                                            &lt;fo:table border-color="black" border-style="solid" border-width="1pt" table-layout="fixed" width="100%"&gt;
                                                &lt;xsl:variable name="columns"&gt;
                                            &lt;xsl:value-of select="count(Columns/Column)" /&gt;
                                        &lt;/xsl:variable&gt;
                                                &lt;xsl:for-each select="Columns/Column"&gt;
                                                    &lt;fo:table-column /&gt;
                                                &lt;/xsl:for-each&gt;
                                                &lt;fo:table-body font-size="10pt"&gt;
                                                    &lt;fo:table-row height="13pt"&gt;
                                                        &lt;fo:table-cell background-color="#000000" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt" number-columns-spanned="{$columns}"&gt;
                                                            &lt;fo:block font-weight="bold" text-align="center" color="#FFFFFF"&gt;
                                                                &lt;xsl:value-of select="Columns/Column[1]/@Description" /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/fo:table-row&gt;
                                                    &lt;xsl:if test="Columns/Column[2]/@Description='true'"&gt;
                                                        &lt;fo:table-row height="13pt"&gt;
                                                            &lt;xsl:for-each select="Columns/Column"&gt;
                                                                &lt;fo:table-cell background-color="#CCCCCC" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                                    &lt;fo:block font-weight="bold" text-align="left"&gt;
                                                                        &lt;xsl:value-of select="translate(@Name,'_',' ')" /&gt;
                                                                    &lt;/fo:block&gt;
                                                                &lt;/fo:table-cell&gt;
                                                            &lt;/xsl:for-each&gt;
                                                        &lt;/fo:table-row&gt;
                                                    &lt;/xsl:if&gt;
                                                    &lt;xsl:for-each select="Row"&gt;
                                                        &lt;fo:table-row height="13pt"&gt;
                                                            &lt;xsl:for-each select="child::*"&gt;
                                                                &lt;fo:table-cell background-color="#FFFFFF" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                                    &lt;fo:block font-weight="normal" text-align="left"&gt;
                                                                        &lt;xsl:value-of select="." /&gt;
                                                                    &lt;/fo:block&gt;
                                                                &lt;/fo:table-cell&gt;
                                                            &lt;/xsl:for-each&gt;
                                                        &lt;/fo:table-row&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-body&gt;
                                            &lt;/fo:table&gt;
                                            &lt;fo:block text-indent="2pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt"&gt;
                                            &lt;/fo:block&gt;
                                        &lt;/xsl:otherwise&gt;
                                    &lt;/xsl:choose&gt;
                                &lt;/xsl:otherwise&gt;
                            &lt;/xsl:choose&gt;
                        &lt;/xsl:for-each&gt;
                    &lt;/fo:flow&gt;
                &lt;/fo:page-sequence&gt;
            &lt;/xsl:for-each&gt;
        &lt;/fo:root&gt;
    &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</code></pre>

<p>It works just fine. Only problem is For Rowset 25, I have too many columns and it does not look good so I want to change the orientation to landscape just for Rowset 25 of my XML while I want others as Portrait.</p>

<p>The part of the XML for which I need landscape orientation looks like following:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;

&lt;Rowset&gt;
    &lt;Columns&gt;
        &lt;Column Description="Box Number" MaxRange="100" MinRange="0" Name="Tote" SQLDataType="1" SourceColumn="Tote"/&gt;
        &lt;Column Description="true" MaxRange="100" MinRange="0" Name="Status" SQLDataType="1" SourceColumn="Status"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Shift" SQLDataType="1" SourceColumn="Shift"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Lot" SQLDataType="1" SourceColumn="Lot"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Qty" SQLDataType="1" SourceColumn="Qty"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Date" SQLDataType="1" SourceColumn="Date"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="User" SQLDataType="1" SourceColumn="User"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Cavity" SQLDataType="1" SourceColumn="Cavity"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Mainbody_Cavity" SQLDataType="1" SourceColumn="Mainbody_Cavity"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Canc_By" SQLDataType="1" SourceColumn="Canc_By"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Canc_On" SQLDataType="1" SourceColumn="Canc_On"/&gt;
        &lt;Column Description="" MaxRange="100" MinRange="0" Name="Comment" SQLDataType="1" SourceColumn="Comment"/&gt;
    &lt;/Columns&gt;
    &lt;Row&gt;
        &lt;Tote&gt;1&lt;/Tote&gt;
        &lt;Status&gt;Inspection Stock&lt;/Status&gt;
        &lt;Shift&gt;1&lt;/Shift&gt;
        &lt;Lot&gt;12345678&lt;/Lot&gt;
        &lt;Qty&gt;10&lt;/Qty&gt;
        &lt;Date&gt;01/13/2016 09:14:26&lt;/Date&gt;
        &lt;User&gt;XYZ&lt;/User&gt;
        &lt;Cavity&gt;K11&lt;/Cavity&gt;
        &lt;Mainbody_Cavity&gt;P11, P21, P31&lt;/Mainbody_Cavity&gt;
        &lt;Canc_By&gt;ABCXYZ&lt;/Canc_By&gt;
        &lt;Canc_On&gt;01/13/2016 09:20:26&lt;/Canc_On&gt;
        &lt;Comment&gt;Cancelled.&lt;/Comment&gt;
    &lt;/Row&gt;
    &lt;Row&gt;
        &lt;Tote&gt;2&lt;/Tote&gt;
        &lt;Status&gt;Inspection Stock&lt;/Status&gt;
        &lt;Shift&gt;1&lt;/Shift&gt;
        &lt;Lot&gt;12345678&lt;/Lot&gt;
        &lt;Qty&gt;10&lt;/Qty&gt;
        &lt;Date&gt;01/13/2016 09:14:26&lt;/Date&gt;
        &lt;User&gt;XYZ&lt;/User&gt;
        &lt;Cavity&gt;K11&lt;/Cavity&gt;
        &lt;Mainbody_Cavity&gt;P11, P21, P31&lt;/Mainbody_Cavity&gt;
        &lt;Canc_By&gt;ABCXYZ&lt;/Canc_By&gt;
        &lt;Canc_On&gt;01/13/2016 09:20:26&lt;/Canc_On&gt;
        &lt;Comment&gt;Cancelled.&lt;/Comment&gt;
    &lt;/Row&gt;
    &lt;Row&gt;
        &lt;Tote&gt;3&lt;/Tote&gt;
        &lt;Status&gt;Inspection Stock&lt;/Status&gt;
        &lt;Shift&gt;1&lt;/Shift&gt;
        &lt;Lot&gt;12345678&lt;/Lot&gt;
        &lt;Qty&gt;10&lt;/Qty&gt;
        &lt;Date&gt;01/13/2016 09:14:26&lt;/Date&gt;
        &lt;User&gt;XYZ&lt;/User&gt;
        &lt;Cavity&gt;K11&lt;/Cavity&gt;
        &lt;Mainbody_Cavity&gt;P11, P21, P31&lt;/Mainbody_Cavity&gt;
        &lt;Canc_By&gt;ABCXYZ&lt;/Canc_By&gt;
        &lt;Canc_On&gt;01/13/2016 09:20:26&lt;/Canc_On&gt;
        &lt;Comment&gt;Cancelled.&lt;/Comment&gt;
    &lt;/Row&gt;
&lt;/Rowset&gt;
</code></pre>

<p>This Rowset appears at position 25.</p>

<p>Is it even possible to achieve it?</p>

<p>Thanks !</p>

<p>After Kevin's answer, I tried with following XSLT:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:template match="/"&gt;
        &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family = "Helvetica" font-size = "10px"&gt;
            &lt;fo:layout-master-set&gt;
                &lt;fo:simple-page-master margin-bottom="0.5cm" margin-left="0.75cm" margin-right="0.75cm" margin-top="0.5cm" master-name="first" page-height="27.9cm" page-width="21.6cm"&gt;
                    &lt;fo:region-body margin-bottom = "0.5cm" margin-top = "0.25cm"/&gt;
                    &lt;fo:region-before extent = "0cm"/&gt;
                    &lt;fo:region-after extent = "0.5cm"/&gt;
                &lt;/fo:simple-page-master&gt;
                &lt;fo:simple-page-master margin-bottom="0.5cm" margin-left="0.75cm" margin-right="0.75cm" margin-top="0.5cm" master-name="landscape" page-height="21.6cm" page-width="27.9cm"&gt;
                    &lt;fo:region-body margin-bottom = "0.5cm" margin-top = "0.25cm"/&gt;
                    &lt;fo:region-before extent = "0cm"/&gt;
                    &lt;fo:region-after extent = "0.5cm"/&gt;
                &lt;/fo:simple-page-master&gt;
            &lt;/fo:layout-master-set&gt;
            &lt;xsl:for-each select="Rowsets"&gt;
                &lt;xsl:for-each select="Rowset"&gt;
                    &lt;xsl:choose&gt;
                        &lt;xsl:when test="position()=27"&gt;
                            &lt;fo:page-sequence master-reference="landscape"&gt;
                                &lt;fo:static-content flow-name="xsl-region-before"&gt;
                                    &lt;fo:block font-size="9pt" line-height="3pt" text-align-last="justify"&gt;
                                        &lt;fo:inline id="DNumber"&gt;
                                DNumber [DNumber]
                            &lt;/fo:inline&gt;
                                        &lt;fo:leader leader-pattern = "space"/&gt;
                                        &lt;fo:inline id="DNumberVersion"&gt;
                                Version [DNumberVersion]
                            &lt;/fo:inline&gt;
                                    &lt;/fo:block&gt;
                                &lt;/fo:static-content&gt;
                                &lt;fo:static-content flow-name="xsl-region-after"&gt;
                                    &lt;fo:block font-size="8pt" line-height="6pt" text-align-last="justify"&gt;
                            Eletronic Batch Record
                            &lt;fo:inline id="Date"&gt;
                                Date [currentDate]
                            &lt;/fo:inline&gt;
                            &lt;fo:leader leader-pattern = "space"/&gt;
                            Page
                            &lt;fo:page-number/&gt;
                        &lt;/fo:block&gt;
                                &lt;/fo:static-content&gt;
                                &lt;fo:flow flow-name="xsl-region-body"&gt;
                                    &lt;fo:table border-color="black" border-style="solid" border-width="1pt" table-layout="fixed" width="100%"&gt;
                                        &lt;xsl:variable name="columns"&gt;
                                            &lt;xsl:value-of select="count(Columns/Column)" /&gt;
                                        &lt;/xsl:variable&gt;
                                        &lt;xsl:for-each select="Columns/Column"&gt;
                                            &lt;xsl:choose&gt;
                                                &lt;xsl:when test="position()=1"&gt;
                                                    &lt;fo:table-column column-width="30pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=2"&gt;
                                                    &lt;fo:table-column column-width="55pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=3"&gt;
                                                    &lt;fo:table-column column-width="32pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=4"&gt;
                                                    &lt;fo:table-column column-width="35pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=5"&gt;
                                                    &lt;fo:table-column column-width="55pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=6"&gt;
                                                    &lt;fo:table-column column-width="40pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=7"&gt;
                                                    &lt;fo:table-column column-width="35pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=8"&gt;
                                                    &lt;fo:table-column column-width="58pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=9"&gt;
                                                    &lt;fo:table-column column-width="55pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=10"&gt;
                                                    &lt;fo:table-column column-width="51pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=11"&gt;
                                                    &lt;fo:table-column column-width="55pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:when test="position()=12"&gt;
                                                    &lt;fo:table-column column-width="75pt"/&gt;
                                                &lt;/xsl:when&gt;
                                                &lt;xsl:otherwise&gt;
                                                    &lt;fo:table-column/&gt;
                                                &lt;/xsl:otherwise&gt;
                                            &lt;/xsl:choose&gt;
                                        &lt;/xsl:for-each&gt;
                                        &lt;fo:table-body font-size="10pt"&gt;
                                            &lt;fo:table-row height="13pt"&gt;
                                                &lt;fo:table-cell background-color="#000000" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt" number-columns-spanned="{$columns}"&gt;
                                                    &lt;fo:block font-weight="bold" text-align="center" color="#FFFFFF"&gt;
                                                        &lt;xsl:value-of select="Columns/Column[1]/@Description" /&gt;
                                                    &lt;/fo:block&gt;
                                                &lt;/fo:table-cell&gt;
                                            &lt;/fo:table-row&gt;
                                            &lt;xsl:if test="Columns/Column[2]/@Description='true'"&gt;
                                                &lt;fo:table-row height="13pt"&gt;
                                                    &lt;xsl:for-each select="Columns/Column"&gt;
                                                        &lt;fo:table-cell background-color="#CCCCCC" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                            &lt;fo:block font-weight="bold" text-align="left"&gt;
                                                                &lt;xsl:value-of select="translate(@Name,'_',' ')" /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-row&gt;
                                            &lt;/xsl:if&gt;
                                            &lt;xsl:for-each select="Row"&gt;
                                                &lt;fo:table-row height="13pt"&gt;
                                                    &lt;xsl:for-each select="child::*"&gt;
                                                        &lt;fo:table-cell background-color="#FFFFFF" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                            &lt;fo:block font-weight="normal" text-align="left"&gt;
                                                                &lt;xsl:value-of select="." /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-row&gt;
                                            &lt;/xsl:for-each&gt;
                                        &lt;/fo:table-body&gt;
                                    &lt;/fo:table&gt;
                                &lt;/fo:flow&gt;
                            &lt;/fo:page-sequence&gt;
                        &lt;/xsl:when&gt;
                        &lt;xsl:otherwise&gt;
                            &lt;xsl:choose&gt;
                                &lt;xsl:when test="Columns/Column[1]/@Description = 'Break'"&gt;
                                    &lt;fo:block page-break-before="always" /&gt;
                                &lt;/xsl:when&gt;
                                &lt;xsl:otherwise&gt;
                                    &lt;fo:page-sequence master-reference="first"&gt;
                                        &lt;fo:static-content flow-name="xsl-region-before"&gt;
                                            &lt;fo:block font-size="9pt" line-height="3pt" text-align-last="justify"&gt;
                                                &lt;fo:inline id="DNumber"&gt;
                                DNumber [DNumber]
                            &lt;/fo:inline&gt;
                                                &lt;fo:leader leader-pattern = "space"/&gt;
                                                &lt;fo:inline id="DNumberVersion"&gt;
                                Version [DNumberVersion]
                            &lt;/fo:inline&gt;
                                            &lt;/fo:block&gt;
                                        &lt;/fo:static-content&gt;
                                        &lt;fo:static-content flow-name="xsl-region-after"&gt;
                                            &lt;fo:block font-size="8pt" line-height="6pt" text-align-last="justify"&gt;
                            Eletronic Batch Record
                            &lt;fo:inline id="Date"&gt;
                                Date [currentDate]
                            &lt;/fo:inline&gt;
                            &lt;fo:leader leader-pattern = "space"/&gt;
                            Page
                            &lt;fo:page-number/&gt;
                        &lt;/fo:block&gt;
                                        &lt;/fo:static-content&gt;
                                        &lt;fo:flow flow-name="xsl-region-body"&gt;
                                            &lt;fo:table border-color="black" border-style="solid" border-width="1pt" table-layout="fixed" width="100%"&gt;
                                                &lt;xsl:variable name="columns"&gt;
                                            &lt;xsl:value-of select="count(Columns/Column)" /&gt;
                                        &lt;/xsl:variable&gt;
                                                &lt;xsl:for-each select="Columns/Column"&gt;
                                                    &lt;fo:table-column /&gt;
                                                &lt;/xsl:for-each&gt;
                                                &lt;fo:table-body font-size="10pt"&gt;
                                                    &lt;fo:table-row height="13pt"&gt;
                                                        &lt;fo:table-cell background-color="#000000" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt" number-columns-spanned="{$columns}"&gt;
                                                            &lt;fo:block font-weight="bold" text-align="center" color="#FFFFFF"&gt;
                                                                &lt;xsl:value-of select="Columns/Column[1]/@Description" /&gt;
                                                            &lt;/fo:block&gt;
                                                        &lt;/fo:table-cell&gt;
                                                    &lt;/fo:table-row&gt;
                                                    &lt;xsl:if test="Columns/Column[2]/@Description='true'"&gt;
                                                        &lt;fo:table-row height="13pt"&gt;
                                                            &lt;xsl:for-each select="Columns/Column"&gt;
                                                                &lt;fo:table-cell background-color="#CCCCCC" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                                    &lt;fo:block font-weight="bold" text-align="left"&gt;
                                                                        &lt;xsl:value-of select="translate(@Name,'_',' ')" /&gt;
                                                                    &lt;/fo:block&gt;
                                                                &lt;/fo:table-cell&gt;
                                                            &lt;/xsl:for-each&gt;
                                                        &lt;/fo:table-row&gt;
                                                    &lt;/xsl:if&gt;
                                                    &lt;xsl:for-each select="Row"&gt;
                                                        &lt;fo:table-row height="13pt"&gt;
                                                            &lt;xsl:for-each select="child::*"&gt;
                                                                &lt;fo:table-cell background-color="#FFFFFF" border-style="solid" border-width="1pt" padding-left="5pt" padding-top="5pt"&gt;
                                                                    &lt;fo:block font-weight="normal" text-align="left"&gt;
                                                                        &lt;xsl:value-of select="." /&gt;
                                                                    &lt;/fo:block&gt;
                                                                &lt;/fo:table-cell&gt;
                                                            &lt;/xsl:for-each&gt;
                                                        &lt;/fo:table-row&gt;
                                                    &lt;/xsl:for-each&gt;
                                                &lt;/fo:table-body&gt;
                                            &lt;/fo:table&gt;
                                            &lt;fo:block text-indent="2pc" space-after="7pt" space-before.minimum="6pt" space-before.optimum="8pt" space-before.maximum="10pt"&gt;
                                            &lt;/fo:block&gt;
                                        &lt;/fo:flow&gt;
                                    &lt;/fo:page-sequence&gt;
                                &lt;/xsl:otherwise&gt;
                            &lt;/xsl:choose&gt;
                        &lt;/xsl:otherwise&gt;
                    &lt;/xsl:choose&gt;
                &lt;/xsl:for-each&gt;
            &lt;/xsl:for-each&gt;
        &lt;/fo:root&gt;
    &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</code></pre>

<p>But I'm geeting follwoing error:</p>

<pre><code>[ERROR] [Renderer_1]org.apache.fop.fo.ValidationException: Property ID "DNumber" (found on "fo:inline") previously used; ID values must be unique within a document! (See position 4:-1)
</code></pre>

<p>Not sure what's wrong? How can I give inline ID at both the placs without creating this error?</p>