RPE unable to process the caption tag post alignment change in RQM
Hi,
I have inserted table in rich text field of one of the sections in RQM test plan.
Now, I generated document using custom template in RPE and I am getting the table caption and Table of Tables. However, Table caption is Left Aligned.
I need to get the table caption as Center Aligned. So, I aligned the caption in RQM test plan as center aligned. However, after that table caption is not coming and no value in table of tables is shown.
Can anybody help to resolve the issue?
Regards,
Ajay Kumar
2 answers
You can create a defect against RQM for this. If you see the XHTML data returned by RQM it is like the following:
p><p>My Table</p><table
style="overflow-wrap:break-word;table-layout:fixed;width:500px;" dir="ltr"
border="1"><tbody><tr><td style="overflow: hidden; width: 250px;">11</td><td
style="overflow: hidden; width: 250px;">12</td></tr><tr><td style="overflow: hidden; width:
250px;">21</td><td style="overflow: hidden; width: 250px;">22</td></tr><tr><td
style="overflow: hidden; width: 250px;">31</td><td style="overflow: hidden; width:
250px;">32</td></tr></tbody></table>
style="overflow-wrap:break-word;table-layout:fixed;width:500px;" dir="ltr"
border="1"><tbody><tr><td style="overflow: hidden; width: 250px;">11</td><td
style="overflow: hidden; width: 250px;">12</td></tr><tr><td style="overflow: hidden; width:
250px;">21</td><td style="overflow: hidden; width: 250px;">22</td></tr><tr><td
style="overflow: hidden; width: 250px;">31</td><td style="overflow: hidden; width:
250px;">32</td></tr></tbody></table>
Ideally <caption> tag must be inserted immediately after the <table> tag so that it will be considered as table caption and shown in Table of Tables. Also, since there is no "align" attribute for caption, it is always left aligned.
You can try using a post processing macro that inserts Table caption for all the tables in the output. I don't think of other workarounds in RPE.
Comments
Pl refer XML:
1. Before Alignment
<table border="1" dir="ltr" style="table-layout: fixed; width: 500px; word-wrap: break-word;">
<caption>Caption Check</caption>
<tbody><tr>...</tr><tr>...</tr><tr>...</tr></tbody>
</table>
2. After Alignment of Caption
<table border="1" dir="ltr" style="table-layout: fixed; width: 500px; word-wrap: break-word;">
<caption><p style="text-align: left;">Caption Check</p></caption>
<tbody><tr>...</tr><tr>...</tr><tr>...</tr></tbody>
</table>
In both caption is in <table> tag, however after alignment it is in <p>. As a result while publishing it seems that it is considered as normal para rather than caption as it was handled before alignment.
So, it seems the issue is in RPE processing.
I was checking the XHTML parsed by RPE, so did not realize RPE is the culprit (and not RQM).
If you print RQM test plan section containing table through Script Expression with only "XHTML Input" checked in RPE, the XHTML will have caption element outside the table, due to which it is not added as table caption in the output.
This is an issue with parsing in RPE. As a workaround, if you can somehow move <caption> element after <table> (using Script Expression with replace function along with regexp), you will get the table caption correctly.