🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by kornik Sat, 03 Jan 2009 00:11
jak powinien wyglądać warunek xpath
#10041
Author: kornik
Date: Sat, 03 Jan 2009 00:11
45 lines
1342 bytes
Jak powinien wyglądać warunek xpath dla takich danych:

<table>
   <tr>
     <td>
       <div>007</div>
     </td>

     <td>
       <div>cos </div>
     </td>

     <td>
       <div>cos innego</div>
     </td>

   </tr>

   <tr>
     <td>
       <div>008</div>
     </td>
   </tr>

   <tr>
     <td>
       <div>009</div>
     </td>
   </tr>

</table>


Interesuje mnie element
//table/tr
który zawiera <div>007</div>


Próbowałem tak
//table/tr/td[div=007]/parent::node()

Ale dostaje:
<div>007</div>
<div>cos </div>
<div>cos innego</div>
Re: jak powinien wyglądać warunek xpath
#10042
Author: ruf10
Date: Sat, 03 Jan 2009 08:52
18 lines
1102 bytes
kornik pisze:

> Interesuje mnie element
> //table/tr
> który zawiera <div>007</div>
> 
> 
> Próbowałem tak
> //table/tr/td[div=007]/parent::node()
> 
> Ale dostaje:
> <div>007</div>
> <div>cos </div>
> <div>cos innego</div>

//table/tr[td[div=007]]

piszę z pamięci, nie sprawdzałem
Re: jak powinien wyglądać warunek xpath
#10043
Author: szomiz
Date: Sat, 03 Jan 2009 09:53
12 lines
1333 bytes
Użytkownik "ruf10" <rufio@none.pl> napisał w wiadomości 
news:gjn8vm$6m4$1@achot.icm.edu.pl...

> //table/tr[td[div=007]]
>
A ja, zeby sie nie zdziwic, napisalbym:

[td/div/text()='007']

Podwojne kwadratowe - tez zadzialaja, ale - MSZ - wolniej.

sz. 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads