Re: DOM - parse HTML document

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Satyam,

> That is correct but it is not complete.  Everything that relies 
> on a unique id would fail, CSS amongst others(which is what this 
> article covers), but not the only one.

> Basically there are two functions to get elements by id or name:
> getElementById and getElementsByName.  Notice the first one returns 
> a single element since there cannot be more than one, the second one
> returns a collection of elements, since duplicates are allowed.  Thus, 
> if you put an id in an element, it is because you want to reach it, 
> but if the id is duplicated then you cannot reach it any longer.

Well, now that we know I can't change the fact that the website programmer used a multiple id (website is not maintained by me), how can I manage to grab the content of "my" <td>-fields?

Example:
...
<tr id = 'tr01'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr02'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr01'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
<tr id = 'tr02'>
<td>1</td><td>2</td><td>3</td><td>4</td>
</tr>
...

Using DOM functions for sure :-)
http://www.php.net/manual/en/ref.dom.php


Thank you for any help!


LS
-- 


NEU: GMX DSL Sofort-Start-Set – blitzschnell ins Internet!
Echte DSL-Flatrate ab 0,- Euro* http://www.gmx.net/de/go/dsl

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux