Page 1 of 1

Vertical spans and page breaks

Posted: Tue Nov 14, 2023 6:53 pm
by gszabo
Hello,
I am using the Oxygen "DITA Map PDF - based on HTML 5 & CSS" transformation, and need to keep all vertically spanned cells together. How is this done?
I tried the following XPath in the selector:

Code: Select all

*[class ~= "topic/entry"][oxy_xpath("count(preceding-sibling::node()) + 1 + count(following-sibling::node()) != count(ancestor::table/colgroup/col)")]{
    page-break-before: avoid !important;
}
However, this causes the following errors, and the spanned rows print on multiple pages:

Code: Select all

ERROR AuthorDocumentFacadeImpl$2 - [CH][ERROR] file:/C:/Program%20Files/Oxygen%20XML%20Editor%2026/frameworks/dita/DITA-OT/plugins/com.curtis-instruments.dita/publishing/templates/Curtis%20DITA%20PDF/css/curtis_pdf_topic.css  [150:27] encountered "oxy_xpath(". Was expecting one of: <IDENT> <NAMESPACE_IDENT> 
     [java] WARN  AuthorDocumentFacadeImpl$2 - [CH][WARN] file:/C:/Program%20Files/Oxygen%20XML%20Editor%2026/frameworks/dita/DITA-OT/plugins/com.curtis-instruments.dita/publishing/templates/Curtis%20DITA%20PDF/css/curtis_pdf_topic.css  [150:151] Skipping: ]{
     [java]     page-break-before: avoid !important;
     [java] }
     
I believe the Xpath (which tests for inequality between the # of a cell's sibling cells + 1 to the # of table columns) itself is correct. I'm suspecting I am either doing something wrong w/the use of oxy-path() in the selector, or am just attempting something convoluted.

For reference, here's the DITA source for the spanned cells:

Code: Select all

<row>
	<entry><codeph>param-canIndex-ph</codeph></entry>
	<entry morerows="2">See <xref href="curtis_parameter_inline_elements.dita"
			type="topic" format="dita" scope="local"/>.</entry>
</row>
<row>
	<entry><codeph>param-displayName-ph</codeph></entry>
</row>
<row>
	<entry><codeph>param-vclAlias-ph</codeph></entry>
</row>
Thank you for your help.

Re: Vertical spans and page breaks

Posted: Wed Nov 15, 2023 11:24 am
by julien_lacour
Hello,

XPath queries aren't supported in CSS selectors, you can only use the oxy_xpath() function as properties values.

Instead of using XPath, why not simply apply the rule on table cells having the rowspan attribute set?

Code: Select all

*[class ~= "topic/entry"][rowspan] {
  page-break-before: avoid;
}
Regards,
Julien