[thelist] parsing my XML result in php

Tom Dell'Aringa pixelmech at yahoo.com
Fri Dec 27 10:04:01 CST 2002


Ok, now that I have my XML result, I need to handle it. I've been
doing some searching around and notice that Expat is pretty popular
for this, and I am reading an article that uses DOM XML as well. The
DOM XML way seems more intuitive - does anyone have an opinion on
these?

Question is - do I need to go through all that... I don't have much
to parse. Here is what I am getting back:

---------------------------
RESPONSE :: <br />HTTP/1.1 200 OK
Date: Fri, 27 Dec 2002 15:51:34 GMT
Server: Apache/1.3.20 Sun Cobalt (Unix) Chili!Soft-ASP/3.6.2
mod_jk/1.1.0 mod_ssl/2.8.4 OpenSSL/0.9.6g PHP/4.1.2
mod_auth_pam_external/0.1 FrontPage/4.0.4.3 mod_perl/1.25
X-StoreSense: 5.1.0.212
Cache-Control: no-cache
Connection: close
Content-Type: text/xml

<?xml version="1.0"?>
<XTE>
<Response type="Product" txnid="pm01"
timestamp="2002-12-27T15:51:34Z">
<Outcome>Success</Outcome>
<Product>
<Description/>
<ProductName>Kiddush Cup #1052</ProductName>
<ProductNo>117</ProductNo>
</Product>
</Response>
</XTE>
----------------------------------

The only thing I need from the above is the <ProductName> and the
<ProductNumber> (and maybe the description..not sure yet.)

Is there another way to do this other than parsing the XML? I might
guess you could do it with regexp somehow, but I'm a total newb on
that.

Tom

=====
var me = tom.pixelmech.webDeveloper();

http://www.pixelmech.com/
http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the thelist mailing list