Count of rows in a DITA table

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Count of rows in a DITA table

Post by ann.jensen »

Hi,
Is there any way of identifying the number of rows in a DITA table through Oxygen XML Author?
Thanks in advance,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Count of rows in a DITA table

Post by Radu »

Hi Ann,

Maybe if the caret is inside the table, you could run an XPath using our XPath toolbar with something like:

Code: Select all

ancestor-or-self::table/count(.//row)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Count of rows in a DITA table

Post by ann.jensen »

Hi Radu,
That worked perfectly :-)
thanks again,
Ann
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Count of rows in a DITA table

Post by ann.jensen »

Is it possible to use something like CSS in Oxygen Author to automatically include this value in the DITA table title.
Regards,
Ann
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Count of rows in a DITA table

Post by Radu »

Hi Ann,

Sure, you need to use a CSS selector like:

Code: Select all

*[class~="topic/table"] > *[class~="topic/title"]:after{
content: " [Number of rows]:" oxy_xpath('ancestor::table/count(.//row)');
}
The oxy_xpath may induce editing performance problems though so please do not use it if you have very large topics.

More about using your custom editing CSS with DITA:

http://blog.oxygenxml.com/2016/10/custo ... iting.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Re: Count of rows in a DITA table

Post by ann.jensen »

Thank you for making these things so doable :-)
Post Reply