here is snipplet of the code
TableRow row = tableTag.getRow(i);
TableColumn [] columns = row.getColumns ();
for (int j=0;j<columns.length;j++)
{
cells = ((TableColumn)columns[j]).getChildrenAsNodeArray ();
//System.out.println(cells.length);
for (int k = 0; k < cells.length; k++)
{
if (cells[k] instanceof StringNode)
{
System.out.println(StringNode)cells[k]).getText());
}
}
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe:
for (int k = 0; k < cells.length; k++)
if (cells[k] instanceof StringNode)
System.out.print (StringNode)cells[k]).getText());
System.out.println ();
If you really want to handle text like a browser does, you can use the StringBean. I think it handles tables in the order you want.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
how to i do this
input:
<tr>
<td>Hello <b>world</b></td>
</tr>
expected output
Hello world
result of this code
Hello
world
here is snipplet of the code
TableRow row = tableTag.getRow(i);
TableColumn [] columns = row.getColumns ();
for (int j=0;j<columns.length;j++)
{
cells = ((TableColumn)columns[j]).getChildrenAsNodeArray ();
//System.out.println(cells.length);
for (int k = 0; k < cells.length; k++)
{
if (cells[k] instanceof StringNode)
{
System.out.println(StringNode)cells[k]).getText());
}
}
}
Maybe:
for (int k = 0; k < cells.length; k++)
if (cells[k] instanceof StringNode)
System.out.print (StringNode)cells[k]).getText());
System.out.println ();
If you really want to handle text like a browser does, you can use the StringBean. I think it handles tables in the order you want.