Question

DITA-OT: 1.7.3

Problem: I get an error on an empty chapter in my custom stylesheets:

"fo:block-container" is missing child elements. Required content model: marker* (%block;)+

Default PDF2 styles render fine.

Adding a topic to the chapter makes it go away. The error only gives me the last line number of topic.fo with a column of 0.

Here is the page-sequence (indented), the line the error is on starts right before id="d2e394":

<fo:page-sequence
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    force-page-count="no-force"
    initial-page-number="1"
    master-reference="body-sequence">
    <fo:static-content
        flow-name="xsl-footnote-separator">
        <fo:block>
            <fo:leader
                color="black"
                leader-length="25%"
                leader-pattern="rule"
                rule-style="solid"
                rule-thickness="0.5pt"/>
        </fo:block>
    </fo:static-content>
    <fo:static-content
        flow-name="odd-body-footer">
        <fo:table
            font-size="8pt"
            space-after="0.5in"
            space-after.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="40%"/>
            <fo:table-column
                column-width="20%"/>
            <fo:table-column
                column-width="40%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <fo:block
                            margin-left=".93in"
                            text-align="left">PN: XXXXXX</fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            text-align="center">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-number"/>-<fo:page-number/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-document-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:static-content
        flow-name="even-body-footer">
        <fo:table
            font-size="8pt"
            space-after="0.5in"
            space-after.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="40%"/>
            <fo:table-column
                column-width="20%"/>
            <fo:table-column
                column-width="40%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <fo:block
                            margin-left=".93in"
                            text-align="left">PN: XXXXXX</fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            text-align="center">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-number"/>-<fo:page-number/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-document-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:static-content
        flow-name="odd-body-header">
        <fo:table
            font-size="8pt"
            margin-top="0.50in"
            space-before="10pt"
            space-before.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="50%"/>
            <fo:table-column
                column-width="50%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell
                        display-align="after">
                        <fo:block
                            border-bottom="1pt solid black"
                            margin-left=".93in"
                            text-align="left">
                            <fo:retrieve-marker
                                retrieve-class-name="current-h2"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell
                        display-align="after">
                        <fo:block
                            border-bottom="1pt solid black"
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:static-content
        flow-name="even-body-header">
        <fo:table
            font-size="8pt"
            margin-top="0.50in"
            space-before="10pt"
            space-before.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="50%"/>
            <fo:table-column
                column-width="50%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell
                        display-align="after">
                        <fo:block
                            border-bottom="1pt solid black"
                            margin-left=".93in"
                            text-align="left">
                            <fo:retrieve-marker
                                retrieve-class-name="current-h2"/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell
                        display-align="after">
                        <fo:block
                            border-bottom="1pt solid black"
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:static-content
        flow-name="first-body-header">
        <fo:block
            end-indent="10pt"
            space-before="10pt"
            space-before.conditionality="retain"
            text-align="end"/>
    </fo:static-content>
    <fo:static-content
        flow-name="first-body-footer">
        <fo:table
            font-size="8pt"
            space-after="0.5in"
            space-after.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="40%"/>
            <fo:table-column
                column-width="20%"/>
            <fo:table-column
                column-width="40%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <fo:block
                            margin-left=".93in"
                            text-align="left">PN: XXXXXX</fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            text-align="center">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-number"/>-<fo:page-number/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-document-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:static-content
        flow-name="last-body-header">
        <fo:block/>
    </fo:static-content>
    <fo:static-content
        flow-name="last-body-footer">
        <fo:table
            font-size="8pt"
            space-after="0.5in"
            space-after.conditionality="retain"
            text-align="end"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:table-column
                column-width="40%"/>
            <fo:table-column
                column-width="20%"/>
            <fo:table-column
                column-width="40%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell>
                        <fo:block
                            margin-left=".93in"
                            text-align="left">PN: XXXXXX</fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            text-align="center">
                            <fo:retrieve-marker
                                retrieve-class-name="current-chapter-number"/>-<fo:page-number/>
                        </fo:block>
                    </fo:table-cell>
                    <fo:table-cell>
                        <fo:block
                            margin-right="0.74in"
                            text-align="right">
                            <fo:retrieve-marker
                                retrieve-class-name="current-document-header"/>
                        </fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>
    </fo:static-content>
    <fo:flow
        flow-name="xsl-region-body">
        <fo:marker
            marker-class-name="current-topic-number">6</fo:marker>
        <fo:marker
            marker-class-name="current-chapter-header">test</fo:marker>
        <fo:marker
            marker-class-name="current-document-header">
            <fo:block
                font-size="inherit"
                start-indent="0in">
                <fo:inline
                    border-left-width="0pt"
                    border-right-width="0pt">
                    <fo:inline
                        border-left-width="0pt"
                        border-right-width="0pt">bookmeta/shortdesc<fo:inline
                            baseline-shift="20%"
                            font-size="75%"
                            line-height-shift-adjustment="disregard-shifts"><fo:inline
                                line-height="100%"
                                font-family="Helvetica, Arial Unicode MS"
                                baseline-shift="20%"
                                font-size="smaller">®</fo:inline>
                        </fo:inline>
                    </fo:inline> test</fo:inline>
            </fo:block>
        </fo:marker>
        <fo:block
            font-size="10pt"
            id="d2e394"
            space-after="0.25in"
            line-height-shift-adjustment="disregard-shifts"
            font-family="Helvetica, Arial Unicode MS">
            <fo:marker
                marker-class-name="current-chapter-number">6</fo:marker>
            <fo:marker
                marker-class-name="bookmap-partno"/>
            <fo:table
                table-layout="fixed">
                <fo:table-column
                    column-width="0.75in"/>
                <fo:table-column/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell
                            display-align="after">
                            <fo:block
                                border-bottom="3pt solid black"
                                border-bottom-style="solid"
                                border-bottom-width="2pt"
                                border-top-style="none"
                                border-top-width="2pt"
                                break-before="auto"
                                font-size="18pt"
                                font-weight="bold"
                                keep-with-next.within-column="always"
                                padding-top="10pt"
                                space-after="16.8pt"
                                space-before="0pt"
                                line-height-shift-adjustment="disregard-shifts"
                                font-family="Helvetica, Arial Unicode MS">
                                <fo:inline
                                    id="_OPENTOPIC_TOC_PROCESSING_d80e3474">
                                    <fo:inline
                                        border-bottom-style="none"
                                        border-bottom-width="2pt"
                                        border-top-style="none"
                                        border-top-width="2pt"
                                        font-size="20pt"
                                        font-weight="bold"
                                        padding-top="10pt">
                                        <fo:marker
                                            marker-class-name="chapter-for-fig">6</fo:marker>
                                        <fo:inline
                                            font-size="36pt"
                                            font-weight="bold"
                                            padding-right="0.485in">6</fo:inline>
                                    </fo:inline>
                                </fo:inline>
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell
                            display-align="after">
                            <fo:block
                                border-bottom="3pt solid black"
                                border-bottom-style="solid"
                                border-bottom-width="2pt"
                                border-top-style="none"
                                border-top-width="2pt"
                                break-before="auto"
                                font-size="18pt"
                                font-weight="bold"
                                keep-with-next.within-column="always"
                                padding-top="10pt"
                                space-after="16.8pt"
                                space-before="0pt"
                                line-height-shift-adjustment="disregard-shifts"
                                font-family="Helvetica, Arial Unicode MS">test</fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
            <fo:block-container
                margin-left="0.75in"
                line-height-shift-adjustment="disregard-shifts"
                font-family="Helvetica, Arial Unicode MS"/>
        </fo:block>
    </fo:flow>
</fo:page-sequence>

And here's the equivalent using the default PDF2 styles:

<fo:page-sequence
    force-page-count="even"
    master-reference="body-sequence">
    <fo:static-content
        flow-name="xsl-footnote-separator">
        <fo:block>
            <fo:leader
                color="black"
                leader-length="25%"
                leader-pattern="rule"
                rule-style="solid"
                rule-thickness="0.5pt"/>
        </fo:block>
    </fo:static-content>
    <fo:static-content
        flow-name="odd-body-footer">
        <fo:block
            end-indent="10pt"
            space-after="10pt"
            space-after.conditionality="retain"
            text-align="end"/>
    </fo:static-content>
    <fo:static-content
        flow-name="odd-body-header">
        <fo:block
            end-indent="10pt"
            space-before="10pt"
            space-before.conditionality="retain"
            text-align="end"> | <fo:inline><fo:retrieve-marker
                    retrieve-class-name="current-header"/>
            </fo:inline> | <fo:inline
                font-weight="bold"><fo:page-number/>
            </fo:inline>
        </fo:block>
    </fo:static-content>
    <fo:static-content
        flow-name="first-body-header">
        <fo:block
            end-indent="10pt"
            space-before="10pt"
            space-before.conditionality="retain"
            text-align="end"/>
    </fo:static-content>
    <fo:static-content
        flow-name="first-body-footer">
        <fo:block
            end-indent="10pt"
            space-after="10pt"
            space-after.conditionality="retain"
            text-align="end"/>
    </fo:static-content>
    <fo:static-content
        flow-name="last-body-header">
        <fo:block/>
    </fo:static-content>
    <fo:static-content
        flow-name="last-body-footer">
        <fo:block/>
    </fo:static-content>
    <fo:flow
        flow-name="xsl-region-body">
        <fo:block
            font-size="10pt"
            id="d2e394">
            <fo:marker
                marker-class-name="current-topic-number">6</fo:marker>
            <fo:marker
                marker-class-name="current-header">test</fo:marker>
            <fo:block
                id="_OPENTOPIC_TOC_PROCESSING_d61e3474">
                <fo:block
                    border-bottom-style="solid"
                    border-bottom-width="2pt"
                    border-top-style="solid"
                    border-top-width="2pt"
                    font-size="20pt"
                    font-weight="bold"
                    padding-top="10pt">Chapter <fo:block
                        font-size="40pt"
                        font-weight="bold">6</fo:block>
                </fo:block>
            </fo:block>
            <fo:block
                border-bottom="3pt solid black"
                font-size="18pt"
                font-weight="bold"
                keep-with-next.within-column="always"
                padding-top="16.8pt"
                space-after="16.8pt"
                space-before="0pt"
                line-height-shift-adjustment="disregard-shifts"
                font-family="Helvetica, Arial Unicode MS">test</fo:block>
            <fo:table
                page-break-after="always"
                table-layout="fixed"
                width="100%">
                <fo:table-column
                    column-number="1"
                    column-width="35%"/>
                <fo:table-column
                    column-number="2"
                    column-width="65%"/>
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell>
                            <fo:block
                                end-indent="5pt"
                                font-size="10.5pt"
                                line-height-shift-adjustment="disregard-shifts"
                                font-family="Helvetica, Arial Unicode MS"/>
                        </fo:table-cell>
                        <fo:table-cell
                            border-left-color="black"
                            border-left-style="solid"
                            border-left-width="1pt"
                            padding-left="10pt">
                            <fo:block/>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:block>
    </fo:flow>
</fo:page-sequence>

My styles are so radically different, I'm having difficulties isolating where to start on troubleshooting this issue. Any guidance is appreciated.

Was it helpful?

Solution

I believe the problem lies with the <fo:block-container /> at the very end of your code. It requires a <block> child (and doesn't serve much purpose without it anyway).

Try commenting out that element and see how the transform runs.

If that works (and you still need the <fo:block-container />) add an empty <block> as a child so it's valid even without any child topics.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top