Re: Re: XML Dom Parsing

From: Date: Thu, 14 Apr 2005 15:50:51 +0000
Subject: Re: Re: XML Dom Parsing
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-37246@lists.php.net to get a copy of this message
Ok, But is it just me or is there a problem with xml_tree_node's getElement method? First off, it doesn't take a string as advertised, but an array of strings and second it cops out with an error in the case of XML: <root> <child_a>data</child_a> <child_b>data</child_b> </root> If I call $root->getElement(array('child_a')) I get Call to a member function on a non-object in /usr/local/lib/php/XML/Tree/Node.php on line 255 Surely there needs to be some method to traverse/retrieve the node's elements or am I missing something? Tomas V.V.Cox wrote:
Willo van der Merwe wrote:
Hi Guys/Gals, Some advice please. I need to parse an XML result set from a server. I've been using XML_Parser and deriving a new class per Request Type. This does not work as well as expected, mostly because the XML_Parser looks for specific tags. My XML Docs have quite a bit of CData and Key/Value pairs, e.g. <entry><key><string>My Key</string><value><string>My Value</string></value></entry> which makes looking for specific tags useless. I need a DOM. I don't see any PEAR DOM classes, and I don't particularly want to rely on the user having included DOM support in his/her PHP.* *
XML_Tree is our php-made DOM style class. Tomas V.V.Cox
-- ______________________________ W&C Information Consultants CC Service Excellence for the Internet Tel: (012) 643 0288 Fax: (012) 643 0287 Cell: 083 445 4798

« previous php.pear.dev (#37246) next »