Ask a Question related to PHP Development, Design and Development.
Martin Towell #1
RE: [PHP] Object assignment
Since I can't see the source for append_child(), I'll assume you're using
the $key as the index??
If so, try changing it to just a numeric index, ie, 0, 1, 2, etc.
From: Matt Grimm [mailto:firstname.lastname@example.org]
Sent: Wednesday, 9 July 2003 10:38 AM
Subject: [PHP] Object assignment
I'm having trouble creating objects with DOMXML. As I loop through a level
of nodes, I'm creating a new element based on the array's key name. The XML
might look like this:
<record id="1">Value 1</record>
<record id="2">Value 2</record>
So I'd be doing this with DOMXML in a loop:
$thisChild = $doc->create_element($key);
$thisChild = $ancestor->append_child($thisChild);
Where $key is 'record' in this example, and $ancestor is 'rootElement',
which is carried along in the function.
The problem that when I reach the second element by the same name, and in
the same node level, I'm overwriting the $thisChild object that I just
created. How can I dynamically name these objects so that I can have an
indeterminate number of elements by the same name, in the same level?
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from NOD32 1.452 (20030703) __________
This message was checked by NOD32 for Exchange e-mail monitor.
Martin Towell Guest
I'm working out of the textbook, Macromedia Dreamweaver MX Dynamic Applications, Advanced, Training from the Source, by Jeffrey Bardzell. I'm on...
I got the following warning. Can anyone tell me what the new style is? TIA!!! resp, data = h.get('/index.html', nil ) net/http: warning: old...
Hi - I am taking a course and am supposed to send a message to the newsgroup. This is it. Hans
I'm having trouble creating objects with DOMXML. As I loop through a level of nodes, I'm creating a new element based on the array's key name. The...
If you are really willing to use a replacement for yacc/bison, what about: http://www.antlr.org/pccts133.html Cheers, Sam Quoteing...