Page 1 of 1

Restrict to HTML Table - Textpipe 8.3.7

Posted: Fri Sep 25, 2009 6:00 pm
by Josiah Hincks
I am using the excellent Restriction filters to help me upgrade many HTML files.

BUT I am having problems with Restricting nested HTML tables and need to clarify what I can expect the filter to cope with. I am not sure if this is a "bug" or a "limit".

My query--should the filter be able to cope with any level of nesting in tables? Since nesting is very common in code for HTML tables I was a little surprised that this ...

Code: Select all

<table border="1">
<tr>
  <td>
   <p>This is a paragraph</p>
   <p>This is another paragraph</p>
  </td>
  <td>This cell contains a table:
   <table border="1">
   <tr>
     <td>A</td>
     <td>B</td>
   </tr>
   <tr>
     <td>C</td>
     <td>D</td>
   </tr>
   </table>
  </td>
</tr>
<tr>
  <td>This cell contains a list
   <ul>
    <li>apples</li>
    <li>bananas</li>
    <li>pineapples</li>
   </ul>
  </td>
  <td>HELLO</td>
</tr>
</table>
... produces this under a Table Restriction ... (the lines starting [+++RESTRICTION] are what are in the restriction)

Code: Select all

[+++RESTRICTION]<table border="1">
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td><p>This is a paragraph</p><p>This is another paragraph</p> </td>
[+++RESTRICTION]<td>This cell contains a table:
[+++RESTRICTION]<table border="1">
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td>A</td>
[+++RESTRICTION]<td>B</td>
[+++RESTRICTION]</tr>
[+++RESTRICTION]<tr>
[+++RESTRICTION]<td>C</td>
[+++RESTRICTION]<td>D</td>
[+++RESTRICTION]</tr>
[+++RESTRICTION]</table>
</td>
</tr>
<tr>
<td>This cell contains a list
<ul>
<li>apples</li>
<li>bananas</li>
<li>pineapples</li>
</ul> </td>
<td>HELLO</td>
</tr>
</table>
This seems to indicate that the Restriction is ALWAYS from the first instance of <table> to the first instance of </table>. Have I understood this correctly? And, if so, is that the intended behaviour? If it is intended it will give unintended results on any table that is nested.

Re: Restrict to HTML Table - Textpipe 8.3.7

Posted: Mon Sep 28, 2009 12:01 pm
by DataMystic Support
Sorry - This is a limitation of most pattern matches - they cannot cope with nesting.