Forums / Developer / eZXML getting element values

eZXML getting element values

Author Message

James Ward

Sunday 30 March 2008 3:21:14 pm

Hi All,
I'm hoping someone more familiar with this class than me can help me out. I'm developing a cronjob extension to do an xml import.

Currently I am getting the content by going the following process:

$category = $ad->elementByName( "Category" );
$category_name = $category->first_child();
$category_value = $category_name->content();

I'm guessing there is a much faster way to get straight at the value. Three lines of code for each value seems excessive.

Thanks in advance for any advice.

working at www.wardnet.com
blogging at www.jamesward.ca

James Ward

Monday 31 March 2008 6:22:10 pm

what I needed was;

$category_value = $ad->elementTextContentByName( "Category" );

Cheers.

working at www.wardnet.com
blogging at www.jamesward.ca

Kristof Coomans

Tuesday 01 April 2008 12:37:36 am

Hi James

In case you are developing for eZ Publish 4.x, I recommend you to use the PHP 5 DOM functions instead of the ezxml library. The ezxml library is deprecated and will be removed in future eZ releases.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org