Forum How do I...?

Column-span in XML causing breaks to new page

lsimon
I have an XML document that I'd like to print as a two-column document. I would like the ability (in case we end up with some particularly wide tables) to span content over those two tables.

What I end up getting when I try to span anything over all columns is the content before the spanned content, followed by the spanned content on its very own page, followed by the rest of the document. I've tried messing with just about every combination of display, float and page breaking controls I can think of - I think I'm doing something wrong.

Here is a simplified snippet of the XML I'm trying to run:
<chapter>
<section ao="no" fees="no" guid="13369449" indexinclude="Commissioner of Building" indexnum="83-1-1" number="§ 83-1-1" penalty="no" verbatim="no">
<title revised="false" verbatim="no">Designation of building officials and their powers.</title>
<para revised="false">The Commissioner of Building shall administer and enforce the
Uniform Code, the Energy Code and this chapter, which shall apply
to all areas of the Town of Amherst outside of the Village of Williamsville,
and shall perform such other duties assigned to him hereunder. He
shall be assisted by the Assistant <div style="display:block; column-span:all; width:100%; background-color:yellow;">Banana </div> Commissioner of Building and other
code enforcement personnel assigned to the Building Department. The
Assistant Commissioner of Building shall have the power to act generally
for and in place of the Commissioner of Building during his absence
or inability to act for any reason. The Supervisor shall have the
power to designate a person to act in behalf of the Commissioner of
Building and to exercise all the powers conferred upon him by this
chapter during his absence and that of the Assistant Commissioner
of Building or the inability of both to act for any reason.</para>
</section>
<chapter>


And pertinent CSS:
chapter {
	column-count:2;
	hyphens: auto;
}

section {
	string-set: sect-num attr(number);
	margin-bottom:.375in;
}

section title {
	display:inline;
	text-align:left;
	page-break-after:avoid;
	margin-bottom:0;
	margin-top:0;
}

section title::before {
	content: string(sect-num)".";
	font-weight:bold;
	display:inline-block;
	margin-right:6pt;
}


para {
	display:inline;
}

mikeday
I can't reproduce the problem with the snippet that you've posted. Is there a reason why para is inline, yet contains blocks? Also, in your full CSS do you specify that chapter, section, and any other container elements are "display: block"?
lsimon
Sorry - I was hoping I could get away with pieces of the file. I've attached the full sample files.

I think that the para-as-inline is a remnant of some of the more desperate things I tried, just to see if it would make a difference. Yes - in the full test file, sections are inside something displaying as block.
  1. 083 Test.xml35.1 kB
  2. GX2C.css0.9 kB
  3. base.css11.1 kB
mikeday
Thanks, that's very interesting. The problem seems to be triggered by applying "prince-page-group: start" to the article element, which is not what I would have expected at all. Here is a trimmed down test case that demonstrates the same issue:
<html>
<body>
<div style="columns: 2">
<div style="prince-page-group: start">
Hello!
<div style="column-span: all; background: yellow">banana</div>
World!
</div>
</div>
</body>
</html>

A quick workaround seems to be applying the columns to article, instead of chapter. We will investigate this issue and see if we can fix it for the next release of Prince. Thanks again for letting us know, it's quite subtle! :)
lsimon
Oh that's a tricky one.

Alright! I'll give that a try - thank you!
mikeday
We have fixed this issue in Prince 9, available now. Thanks again for letting us know! :D