Vertical spans and page breaks

Post here questions and problems related to editing and publishing DITA content.
gszabo
Posts: 11
Joined: Wed Jan 25, 2023 1:15 am

Vertical spans and page breaks

Post 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.
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Vertical spans and page breaks

Post 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
Post Reply