Hi all,

I'm trying to use jxpath-1.3 to query the content of some tags within an
html fragment.
Given the file 'html.frag.response.html' I want to explore all the TR
tag in the document.

For what I know I can do this stuff with the following lines of code:

  String tableFragment = loadfromthefile();

  JXPathContext context = JXPathContext.newContext(tableFragment);

  Iterator it = context.iteratePointers("//TR");

  while (it.hasNext()) {
     Pointer msgPointer = (Pointer) it.next();

     msgPointer.asPath();

     System.out.println(msgPointer);

What I get is always an empty Iterator so there's nothing to iterate on,
as there were no TR tag
in the document.

What am I doing wrong?

TIA.

---
Stefano
<TABLE border="1" fontsize="4" bgcolor="#54FF87" name="dataTable" 
id="dataTable"  style='cursor:hand'>
    <tr>
        <TH><A href="javascript:sortTable(0)">FROM</A></TH>
        <TH><A href="javascript:sortTable(1)">WHAT</A></TH>
        <TH><A href="javascript:sortTable(2)">MSG</A></TH>
        <TH><A href="javascript:sortTable(3)">GOOD</A></TH>
        <TH><A href="javascript:sortTable(4)">ID_1</A></TH>
        <TH><A href="javascript:sortTable(5)">ID_2</A></TH>
        <TH><A href="javascript:sortTable(6)">CONTENT</A></TH>
        <TH><A href="javascript:sortTable(7)">FROM</A></TH>
        <TH><A href="javascript:sortTable(8)">R</A></TH>
    </TR>
    <TR name="myriga" language = "JavaScript" 
onclick="Riga((this.parentElement).parentElement, this)" 
onMouseover="changeto(event, 'yellow')" onMouseout="changeback(event, 
'54FF87')">
        <TD>Some text</TD>
        <TD>600</TD>
        <TD>Transmission</TD>
        <TD>Good</TD>
        <TD>7098653</TD>
        <TD>060130200000015</TD>
        
<TD>A|1|1111000024|89000|115600|0|50000|76600|89|100000|124600|0|150000|129600|100|2013|02||;B|1115000663|0|0|0|0|0|0;B|1115000664|0|0|0|0|0|0;B|1115000665|0|0|0|0|0|0;B|1115000666|89000|115600|89|100000|124600|100;B|1115000667|0|0|0|0|0|0</TD>
        <TD>A</TD>
        <TD>1</TD>
    </TR>
    <TR name="myriga" language = "JavaScript" 
onclick="Riga((this.parentElement).parentElement, this)" 
onMouseover="changeto(event, 'yellow')" onMouseout="changeback(event, 
'54FF87')">
        <TD>Another text</TD>
        <TD>600</TD>
        <TD>Another transmission</TD>
        <TD>Not Good</TD>
        <TD>7098652</TD>
        <TD>060130200000014</TD>
        
<TD>A|2|EA610039745A|89000|115600|0|50000|76600|89|95000|124600|0|100000|129600|95|2013|02||1111000024;B|1115000663|0|0|0|0|0|0;B|1115000664|0|0|0|0|0|0;B|1115000665|0|0|0|0|0|0;B|1115000666|89000|115600|89|95000|124600|95;B|1115000667|0|0|0|0|0|0</TD>
        <TD>A</TD>
        <TD>2</TD>
    </TR>
</TABLE>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to