Forums / Developer / Transform XML to Array and Array to XML in EZP 3.9.x
H-Works Agency
Wednesday 02 April 2008 7:20:40 am
Hello,
How is it possible into ezp 3.9.x to handle XML structures ?
I need to be able to transform XML to array (available into templates) and Array to XML.
Do i need to use lib/ezxml/ available into ezp sources or do i need to developp my own functions ?
Thanx in advance.
EZP is Great
Maxime Thomas
Wednesday 02 April 2008 11:03:41 pm
Hi,
You can use : - the functions provided via the PHP domxml module.- the eZ API called ezxml.
I have experienced both of these and what I can tell you is that ez API is a quicker way to design and produce extensions.
However, you may except some performances troubles if you are manipulating large xml files. An explanation is the DOM pattern implemented by this two libs. We have developped a SAX parser and it is quicker and don't crash. If you don't want to implement a SAX parser, you may try to cut your xml in little chunks instead of loading it fully.
Maxime Thomas maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou Company Blog : http://www.wascou.org/eng/Company/Blog Technical Blog : http://share.ez.no/blogs/maxime-thomas
Thursday 03 April 2008 3:55:56 am
Thanx a lot for those informations.
But do you know if there is an xml2array and array2xml function inside ezxml ?
If not i have to build it with ezxml lib ?