🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by kornik Sat, 03 Jan 2009 00:17
jak napisać warunek xpath
#10044
Author: kornik
Date: Sat, 03 Jan 2009 00:17
45 lines
1327 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 napisać warunek xpath
#10045
Author: vcs
Date: Sun, 04 Jan 2009 07:17
62 lines
2328 bytes
Np. Tak

<xsl:template match="table">
	<xsl:apply-templates />
</xsl:template>

<xsl:template match="table/tr">
<xsl:value-of select="td[div=007]" />
</xsl:template>

ew. starczy samo
<xsl:value-of select="tr/td[div=007]" />

bać pierwszy element
<xsl:value-of select="tr/td[1]/div" />



On 3 Sty, 01:17, kornik <kor...@kornik.pl> wrote:
> 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>
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