page break in certain cases causes lost content
We have a document from a client in Kotahi that imports incorrectly in XSweet: the first page of content is missing. It's a confidential file, so I'm not sharing it publicly.
The first page consists of headers, then a table which contains text (an abstract for the paper). After the table there is a page break (in its own paragraph); the regular text starts on the next page. When we import to XSweet, the first page content is entirely missing.
If I go in and delete the page break, the title page content imports correctly. If the paragraph with the page break in it (which appears empty) is given text content, the content above it also imports correctly. It's only when the paragraph containing the page break is otherwise empty that the problematic case happens.
Here's what's in the document.xml
at the point at which the problem happens:
<w:p w14:paraId="6907B6C5" w14:textId="75D1BA40" w:rsidR="00E82AA4" w:rsidRPr="00440252" w:rsidRDefault="00E82AA4" w:rsidP="00585668">
<w:pPr>
<w:spacing w:before="120" w:after="0"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cstheme="majorBidi"/>
<w:noProof/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:sectPr w:rsidR="00E82AA4" w:rsidRPr="00440252" w:rsidSect="002D7B7B">
<w:headerReference w:type="default" r:id="rId13"/>
<w:footerReference w:type="default" r:id="rId14"/>
<w:headerReference w:type="first" r:id="rId15"/>
<w:footerReference w:type="first" r:id="rId16"/>
<w:pgSz w:w="12240" w:h="15840"/>
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="0" w:gutter="0"/>
<w:pgNumType w:start="125"/>
<w:cols w:space="720"/>
<w:titlePg/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:pPr>
<w:bookmarkStart w:id="1" w:name="_Hlk138064635"/>
</w:p>
That <w:sectPr>
seems to be the representation of the page break. (In Word, this document does have a title page template, and it does have its own distinct header and footer, which are being called here.) There's no <w:t>
with text content in that particular paragraph; maybe because of that it's getting deleted? Or possibly this is causing problems because it's immediately after a table? Page breaks in and of themselves don't seem to cause problems.
There's a little bit of background on the <w:sectPr>
element here:
A section's properties are stored in a sectPr element. For all sections except the last section, the sectPr element is stored as a child element of the last paragraph in the section.
The problem here might be that there's not really a last paragraph in the section if the section ends with a table? Or it's possible that the page break is coming from the page template, rather than a page break that has been inserted manually. The XML doesn't show a standard Word XML page break, which looks like this:
<w:pPr>
<w:pageBreakBefore/>
</w:pPr>
(these appear later in the texxt) or like this: <w:br w:type="page" />
. The page break seems to be coming from the page template.