Importing using eZSimplifiedXMLInputParser

Author Message

A Costello

Tuesday 14 October 2008 5:02:40 pm

I am importing some data, and everything works well, with the exception of content with links in it. I am utilizing the following code to import ezxmltext.

	    $contentObjectID = $attribute->attribute( "contentobject_id" ); 
	    $parser = new eZSimplifiedXMLInputParser( $contentObjectID, false, 0, false );

	    $data = str_replace( "\r", '', $data );
	    $data = str_replace( "\n", '', $data );
	    $data = str_replace( "\t", ' ', $data );

	    $document = $parser->process( $data );
	    if ( !is_object( $document ) )
	    {
	        if($report)
	        {
		        echo 'Error in xml parsing';
			}
	        return false;
	    }
	    $domString = eZXMLTextType::domString( $document );

	    $attribute->setAttribute( 'data_text', $domString );
	    $attribute->store();

When links are included in the $data variable it extracts the link and in the database I get the following:

<link url_id="27"> LINK TEXT REMOVED </link>

But in the link table there is no link with the id 27. Am I missing something?

A Costello

Thursday 16 October 2008 1:42:46 am

Even if no one has a direct answer, any assistance would be appreciated at this point.

Christophe Saint-Pierre

Wednesday 05 November 2008 12:20:36 am

I'm interrested too by an answer!

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 30 2025 21:41:42
Script start
Timing: Jan 30 2025 21:41:42
Module start 'layout'
Timing: Jan 30 2025 21:41:42
Module start 'content'
Timing: Jan 30 2025 21:41:42
Module end 'content'
Timing: Jan 30 2025 21:41:42
Script end

Main resources:

Total runtime0.0239 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.0060 588.2656151.2266
Module start 'layout' 0.00600.0038 739.4922220.7188
Module start 'content' 0.00980.0127 960.2109997.7578
Module end 'content' 0.02250.0013 1,957.968829.9922
Script end 0.0238  1,987.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.2099140.0002
Check MTime0.00114.4512140.0001
Mysql Total
Database connection0.00093.634710.0009
Mysqli_queries0.002711.299930.0009
Looping result0.00000.059010.0000
Template Total0.00104.310.0010
Template load0.00083.348910.0008
Template processing0.00020.888410.0002
Override
Cache load0.00052.208610.0005
General
dbfile0.00124.861980.0001
String conversion0.00000.028040.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