This is a discussion on Re: Using DOMXML with homogenous elements within the PHP General forums, part of the PHP Programming Forums category; And nevermind, problem solved in another thread. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
And nevermind, problem solved in another thread.
-- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: mgrimm@healthtvchannel.org Web: www.healthtvchannel.org "Matt Grimm" <mgrimm@healthtvchannel.org> wrote in message news:20030710230603.52831.qmail@pb1.pair.com... > I have a final kink to work out of an array to XML parser I've been writing. > The array structure is below, along with the example XML it came from. A > link to the source I'm working on is at bottom. The only problem this > script runs into is when there are multiple elements with the same name on > the same node level. It crams all the values into a single element with > that name, and uses only the final element's attributes. It seemed like > clone_node() was the answer, but it isn't working correctly in this > context -- anyone see why? I sure don't. > > [xml] > <?xml version="1.0"?> > <rootElement> > <record id="1">Value 1</record> > <record id="2">Value 2</record> > </rootElement> > [/xml] > > [array] > Array > ( > [rootElement] => Array > ( > [0] => Array > ( > [record] => Array > ( > [0] => Array > ( > [ATTRIBUTES] => Array > ( > [id] => 1 > ) > > [VALUE] => Value 1 > ) > > [1] => Array > ( > [ATTRIBUTES] => Array > ( > [id] => 2 > ) > > [VALUE] => Value 2 > ) > > ) > > ) > > ) > > ) > [/array] > > Source: > http://www.healthtvchannel.org/test/php2xml.phps > > Thanks, > -- > Matt Grimm > Web Developer > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Parkway > Anchorage, AK 99508 > 907.770.6200 ext. 686 > 907.336.6205 (fax) > E-mail: mgrimm@healthtvchannel.org > Web: www.healthtvchannel.org > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|