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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:34:51
Script start
Timing: Jan 31 2025 01:34:51
Module start 'layout'
Timing: Jan 31 2025 01:34:51
Module start 'content'
Timing: Jan 31 2025 01:34:51
Module end 'content'
Timing: Jan 31 2025 01:34:51
Script end

Main resources:

Total runtime0.0212 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.1328151.2109
Module start 'layout' 0.00490.0030 739.3438220.6875
Module start 'content' 0.00800.0118 960.0313997.9141
Module end 'content' 0.01980.0014 1,957.945333.9922
Script end 0.0212  1,991.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002411.2160140.0002
Check MTime0.00094.3925140.0001
Mysql Total
Database connection0.00062.680410.0006
Mysqli_queries0.00199.027630.0006
Looping result0.00000.047210.0000
Template Total0.00104.910.0010
Template load0.00073.472410.0007
Template processing0.00031.385110.0003
Override
Cache load0.00052.327710.0005
General
dbfile0.00125.691180.0002
String conversion0.00000.033740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs