RE: [PEAR-DEV] xml parser
| From: | Васил Рангелов | Date: | Mon, 26 Mar 2012 19:47:29 +0000 |
| Subject: | RE: [PEAR-DEV] xml parser | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-54885@lists.php.net to get a copy of this message | ||
I personally prefer DOM [1] and XMLReader [2], but SimpleXML [3] and "XML
Parser" [4] work too.
DOM and SimpleXML can be used for both reading and writing, whereas
XMLReader and "XML Parser" are only for reading (with XMLReader having its
writing companion - XMLWriter [5]).
I'm not sure I get your question about "write xml data to a server url"...
the same server your PHP file is running on, or a remote server?
If the former, DOM, SimpleXML and XMLWriter allow you to point a file path
(not a URL) to save the document to.
If the latter, you send it in the same way you'd send any text data - as a
raw body or get/post field of an HTTP request. It's up to the remote server
to handle processing the received data.
[1] http://php.net/DOM
[2] http://php.net/XMLReader
[3] http://php.net/SimpleXML
[4] http://php.net/XML
[5] http://php.net/XMLWriter
-----Original Message-----
From: Mumtaz kj [mailto:mumtaz.kjm@gmail.com]
Sent: Monday, March 26, 2012 8:20 PM
To: pear-dev@lists.php.net
Subject: [PEAR-DEV] xml parser
Hi ,
could you please let me know what is a good method to do xml parsing of a
string returned from a server, using php.
as well as to write xml data to a server url, using php.
i really appreciate your help. thankyou very much
Mumtaj