Table Porperties management

Post here questions and problems related to oXygen frameworks/document types.
Isabelle
Posts: 142
Joined: Fri Jan 20, 2017 1:11 pm

Table Porperties management

Post by Isabelle »

Hello,

We used the version 25.0.0.0 of oxygen sdk.

We use ro.sync.ecss.extensions.docbook.table.properties.Docbook5CALSShowTablePropertiesOperation to manage table properties, and we face two issues.

First, here is the initial table :

Code: Select all

                  <table frame="all" rowsep="1" colsep="1" id="tab-0001">
                     <title>test</title>
                     <tgroup cols="2">
                        <colspec colname="c1" colnum="1" colwidth="1.0*"/>
                        <colspec colname="c2" colnum="2" colwidth="1.0*"/>
                        <tbody>
                           <row>
                              <entry>
                                 <para id="par-0001"/>
                              </entry>
                              <entry>
                                 <para id="par-0002"/>
                              </entry>
                           </row>
                           <row>
                              <entry>
                                 <para id="par-0003"/>
                              </entry>
                              <entry>
                                 <para id="par-0004"/>
                              </entry>
                           </row>
                           <row>
                              <entry>
                                 <para id="par-0005"/>
                              </entry>
                              <entry>
                                 <para id="par-0006"/>
                              </entry>
                           </row>
                        </tbody>
                     </tgroup>
                  </table>
1/ When you want to transform a row into a thead or a tfoot, it added the attribute xmlns on element thead or tfoot and on row element.
This attribute is not xsd compliant.

Code: Select all

<table frame="all" rowsep="1" colsep="1" id="tab-0001">
                     <title>test</title>
                     <tgroup cols="2">
                        <colspec colname="c1" colnum="1" colwidth="1.0*"/>
                        <colspec colname="c2" colnum="2" colwidth="1.0*"/>
                        <thead xmlns="http://docbook.org/ns/docbook">
                           <row xmlns="">
                              <entry>
                                 <para id="par-0001"/>
                              </entry>
                              <entry>
                                 <para id="par-0002"/>
                              </entry>
                           </row>
                        </thead>
                        <tbody>
                           <row>
                              <entry>
                                 <para id="par-0003"/>
                              </entry>
                              <entry>
                                 <para id="par-0004"/>
                              </entry>
                           </row>
                           <row>
                              <entry>
                                 <para id="par-0005"/>
                              </entry>
                              <entry>
                                 <para id="par-0006"/>
                              </entry>
                           </row>
                        </tbody>
                     </tgroup>
                  </table>
2/ When you want to transform the last row of your table into a tfoot, it places the tfoot before the tbody and not after

Code: Select all

                  <table frame="all" rowsep="1" colsep="1" id="tab-0001">
                     <title>test</title>
                     <tgroup cols="2">
                        <colspec colname="c1" colnum="1" colwidth="1.0*"/>
                        <colspec colname="c2" colnum="2" colwidth="1.0*"/>
                        <thead xmlns="http://docbook.org/ns/docbook">
                           <row xmlns="">
                              <entry>
                                 <para id="par-0001"/>
                              </entry>
                              <entry>
                                 <para id="par-0002"/>
                              </entry>
                           </row>
                        </thead>
                        <tfoot xmlns="http://docbook.org/ns/docbook">
                           <row xmlns="">
                              <entry>
                                 <para id="par-0005"/>
                              </entry>
                              <entry>
                                 <para id="par-0006"/>
                              </entry>
                           </row>
                        </tfoot>
                        <tbody>
                           <row>
                              <entry>
                                 <para id="par-0003"/>
                              </entry>
                              <entry>
                                 <para id="par-0004"/>
                              </entry>
                           </row>
                        </tbody>
                     </tgroup>
                  </table>
I did not find the content of the Docbook5CALSShowTablePropertiesOperation class.
Can you tell me, how can I avoid the insertion of the xmlns attribute, and how to place the tfoot after the tbody.
Thanks.

Regards,
Isabelle
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Table Porperties management

Post by Radu »

Hi Isabelle,

The DocBook5 standard has all elements in the namespace "http://docbook.org/ns/docbook". So all DocBook5 related actions are using this namespace when changing the table contents.
You probably use some other kind of XML vocabulary which does not use this namespace at all.
I think you should find the Java code of the Docbook5CALSShowTablePropertiesOperation here:
https://www.oxygenxml.com/maven/com/oxy ... /25.1.0.0/

Also about the tfoot related issue number (2) you mentioned, that's how the DocBook5 vocabulary table defines the <tfoot> element as being inserted after <thead>:
https://tdg.docbook.org/tdg/4.5/tgroup.html

So in conclusion, the Docbook5CALSShowTablePropertiesOperation works well for the DocBook5 specification but not for your XML because your XML has other namespace and elements order so the Docbook5CALSShowTablePropertiesOperation probably could be use as a starting point for you instead of being used directly.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply