Re[5]: [PHP] Object assignment

2003-07-10 Thread Tom Rogers
Hi, Did some more tweaking and if we create a new element for each node ther is no need to clone, saves a few lines of code :) function parseBranch($branch, &$doc, &$parent) { foreach ($branch as $key => $val) { switch ($key) { // parent attribute

Re[4]: [PHP] Object assignment

2003-07-10 Thread Tom Rogers
Hi, Friday, July 11, 2003, 4:30:41 AM, you wrote: MG> Well I've made a signifigant improvement to this function, and it's now the MG> parsing operation is only something like 26 lines. It works flawlessly (so MG> far) for XML that does not have repeat element names on the same level. MG> Which se

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
Well I've made a signifigant improvement to this function, and it's now the parsing operation is only something like 26 lines. It works flawlessly (so far) for XML that does not have repeat element names on the same level. Which seems to be bad form anyway, using similar element names and distingu

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
Interesting -- the clone_node() function does make certain that each element gets its own representation in the output, for any XML I tested. I guess then my problem lies with how I'm looping through the aforementioned array structure to get the values themselves. Thanks, -- Matt Grimm Web Develo

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
The array structure is the one suggested on the xml_parse_into_struct page user comments. Our example XML would parse into this: Array ( [ROOTELEMENT] => Array ( [0] => Array ( [ATTRIBUTES] => Array (

Re[2]: [PHP] Object assignment

2003-07-09 Thread Tom Rogers
Hi, Thursday, July 10, 2003, 6:44:55 AM, you wrote: MG> Tom: MG> Thanks for the help. Using the array setup you described, I end up with the MG> value of each "record" node being appended to a single instance of the MG> parent node. And that single instance of the parent node is the final one M

Re[2]: [PHP] Object assignment

2003-07-09 Thread Tom Rogers
Hi, Thursday, July 10, 2003, 6:44:55 AM, you wrote: MG> Tom: MG> Thanks for the help. Using the array setup you described, I end up with the MG> value of each "record" node being appended to a single instance of the MG> parent node. And that single instance of the parent node is the final one M

Re: [PHP] Object assignment

2003-07-09 Thread Matt Grimm
Tom: Thanks for the help. Using the array setup you described, I end up with the value of each "record" node being appended to a single instance of the parent node. And that single instance of the parent node is the final one that was parsed (the attributes verify this). The example I used belo

Re: [PHP] Object assignment

2003-07-08 Thread Tom Rogers
Hi, Wednesday, July 9, 2003, 10:38:22 AM, you wrote: MG> I'm having trouble creating objects with DOMXML. As I loop through a level MG> of nodes, I'm creating a new element based on the array's key name. The XML MG> might look like this: MG> MG> Value 1 MG> Value 2 MG> MG> So I'd be doin

RE: [PHP] Object assignment

2003-07-08 Thread Martin Towell
8 AM To: [EMAIL PROTECTED] 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: Value 1 Value 2 So I'd be doing this

[PHP] Object assignment

2003-07-08 Thread Matt Grimm
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: Value 1 Value 2 So I'd be doing this with DOMXML in a loop: $thisChild = $doc->create_element($key); $thisChild = $