[PHP] XML functions

2010-03-06 Thread Ahmad F AlTwaijiry

Dears

When i checked the php manual i found many Solutions to read/write xml  
files and im confused now :)


Which function/library is better and is there any new article that  
compare each function/library?


Thanks

Ahmad AlTwaijiry
http://www.AlTwaijiry.com

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



Re: [PHP] XML functions

2010-03-06 Thread Andre Polykanine
Hello Ahmad and all,

  I will expand a little bit your question joining to it: what is
  the better technique to make an RSS feed on the website? The
  website is manually written, no CMS.
-- 
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

- Original message -
From: Ahmad F AlTwaijiry ah...@altwaijiry.com
To: php-general@lists.php.net php-general@lists.php.net
Date: Saturday, March 6, 2010, 7:00:04 PM
Subject: [PHP] XML functions

Dears

When i checked the php manual i found many Solutions to read/write xml  
files and im confused now :)

Which function/library is better and is there any new article that  
compare each function/library?

Thanks

Ahmad AlTwaijiry
http://www.AlTwaijiry.com

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


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



Re: [PHP] XML functions

2010-03-06 Thread Ashley Sheridan
On Sat, 2010-03-06 at 21:50 +0200, Andre Polykanine wrote:

 Hello Ahmad and all,
 
   I will expand a little bit your question joining to it: what is
   the better technique to make an RSS feed on the website? The
   website is manually written, no CMS.
 -- 
 With best regards from Ukraine,
 Andre
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: m_elensule
 
 - Original message -
 From: Ahmad F AlTwaijiry ah...@altwaijiry.com
 To: php-general@lists.php.net php-general@lists.php.net
 Date: Saturday, March 6, 2010, 7:00:04 PM
 Subject: [PHP] XML functions
 
 Dears
 
 When i checked the php manual i found many Solutions to read/write xml  
 files and im confused now :)
 
 Which function/library is better and is there any new article that  
 compare each function/library?
 
 Thanks
 
 Ahmad AlTwaijiry
 http://www.AlTwaijiry.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


That's a very different question, and ought to be in a new thread.
Please don't hijack threads like this.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] XML functions

2010-03-06 Thread Michael A. Peters

Ahmad F AlTwaijiry wrote:

Dears

When i checked the php manual i found many Solutions to read/write xml 
files and im confused now :)


Which function/library is better and is there any new article that 
compare each function/library?


I use DOMDocument.
It works best if the input file you are reading is UTF-8.

It has some issues I haven't yet figured out related to namespaces, 
sometimes when loading perfectly valid XML that uses namespaces for 
import into another document, I lose the namespace and get default 
prepended to the node name. I do not understand why it feels it needs to 
do this, but it apparently does in some cases.


For those cases, I currently use hackish workarounds where I remove the 
namespace with a preg_replace before import into the DOM and then add 
the namespace again using the DOM tools after it has been imported.


Where I have run into this problem is MathML and SVG within XHTML when I 
cache the MathML/SVG as a string in APC for import into documents.


It is not so much an issue with SVG in XHTML as SVG probably is best 
done as an object rather than directly embedded (but when generating SVG 
via DOMDocument I have a similar problem if I am using xlink namespace) 
but it is a problem with MathML which is usually done inline.


It could just be that I'm doing things wrong, but the documentation 
isn't exactly full of working example code.


So anyway, if you use namespaces, you may run into a few frustrating 
kinks, but DOMDocument is what I use, and it is very convenient because 
it is very similar to the JavaScript DOM2 methods (I believe intentionally).


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



Re: [PHP] XML functions

2010-03-06 Thread Michael A. Peters

Andre Polykanine wrote:

Hello Ahmad and all,

  I will expand a little bit your question joining to it: what is
  the better technique to make an RSS feed on the website? The
  website is manually written, no CMS.


I wrote a class to do it -

http://www.phpclasses.org/browse/package/5942.html

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