To start with, an ID should never be repeated. A name can be repeated, an
ID shouldn't. That is why there is a function to get an array of elements
with a certain name but there is none to get a list of elements with the
same ID simply because there shouldn't be any. Something helpful in
traversing the DOM is any tool that gives you a good view of the tree
structure. One such comes already in the Firefox browser.
Satyam
----- Original Message -----
From: "Leonidas Safran" <Elektrik@xxxxxxx>
To: <php-general@xxxxxxxxxxxxx>
Sent: Monday, September 11, 2006 11:11 PM
Subject: DOM - parse HTML document
Hello all,
I don't really get it to work with that functions from
http://www.php.net/manual/en/ref.dom.php
I try to get the content of <td> fields on an external html page, where I
just know some ids of the rows.
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>
...
PS: Please note, that id is written more than once. So
DomDocument->getElementById('tr01') returns only one element and not two
or more...
I can't find out how to grab the data in the td fields... I don't find
examples to look at... :-(
I'd be really glad if somebody could give me some advice or tutorial
websites about that...
Thanks a lot
LS
--
"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php