Re: Parsing an XML return from a POST - resend with a little more information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# rluckhurst@xxxxxxxxxxxxx / 2007-01-10 09:47:39 +1100:
> I have spent most of last night and today looking at XML parsing and now am
> totally confused. Some testing I have done suggests that SimpleXML is not the
> way to go however I am open to suggestions if it might be an answer.

What makes you think simplexml is not for you? I don't say it is, but
you need to tell us exactly what you need.
 
> I would appreciate any help or advice on how to parse this XML response and break it up
> into either an array or individual variables. It is important for this
> application to not only get the data contained between beginning and end tags
> but also the attributes as they contain important data returned from the server.
> I am the first to admit that PHP XML Parsing has me lost.

http://php.net/manual/en/ref.simplexml.php has quite a few examples in
the user-contributed notes. Have you seen the manual?
 
> One other question I do have is that all of the examples I have seen, using the
> xml_parser, seem to be designed around a file being read into the parser. Is it
> possible for the XML data to be contained in a variable and then used in the
> parser?

Many of the examples at http://php.net/manual/en/ref.simplexml.php use a
string variable as the source.

If that page in the manual is correct and there are no bugs, you should
be able to take off with

var_dump(new SimpleXMLElement($xmlstr));

where $xmlstr contains the server response.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux