HTML to eZXML

Author Message

Ammar Ibrahim

Monday 11 December 2006 7:37:41 am

eZXML is driving me nuts. I'm trying to import our old site's content to eZ publish. I wrote a script to do that, anyhow eZSimplifiedXMLInputParser is not working properly and it's causing Fatal errors on some input.

I tried to pass the HTML through tidy to fix the markup, things got better but still it's not working properly, maybe I should file this as a bug, here's the code snippet:

$parser = new eZSimplifiedXMLInputParser( $objectID );
$parser->setParseLineBreaks( true );	
						
//example HTML
$body = '<a target="new" href="http://site.com" >Stock Exchange</a>';
$document = $parser->process($body);

This is causing PHP to exit with the following error:
<b>Fatal error: Call to a member function on a non-object in D:\htdocs\mena\bin\php\text2xml.php on line 69</b>

All I need is to convert HTML to ezXML, is there any script? I tried a few posted here and there, none worked

Xavier Dutoit

Monday 11 December 2006 8:09:04 am

You can do it the quick and dirty way and put a <literal class="html"> class around your content. That's what I ended up doing with RSS imports.

You won't be able to benefit from the ez features, but a least you can import the content.

http://www.sydesy.com

Ammar Ibrahim

Sunday 17 December 2006 12:28:37 am

I tried, but that didn't work, I managed to import by cleaning up using tidy, then removing all "style" and "target" attributes. So far looks good

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 18 2025 18:22:13
Script start
Timing: Jan 18 2025 18:22:13
Module start 'layout'
Timing: Jan 18 2025 18:22:13
Module start 'content'
Timing: Jan 18 2025 18:22:14
Module end 'content'
Timing: Jan 18 2025 18:22:14
Script end

Main resources:

Total runtime0.8206 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.7891152.6094
Module start 'layout' 0.00660.0038 740.398439.3984
Module start 'content' 0.01040.8083 779.7969530.3438
Module end 'content' 0.81870.0019 1,310.140612.2031
Script end 0.8205  1,322.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4702160.0002
Check MTime0.00150.1812160.0001
Mysql Total
Database connection0.00150.180010.0015
Mysqli_queries0.768493.6390570.0135
Looping result0.00060.0671550.0000
Template Total0.769093.720.3845
Template load0.00190.237620.0010
Template processing0.767193.478120.3835
Template load and register function0.00010.015610.0001
states
state_id_array0.00170.213310.0017
state_identifier_array0.00210.255720.0010
Override
Cache load0.00160.1919150.0001
Sytem overhead
Fetch class attribute can translate value0.00090.111120.0005
Fetch class attribute name0.00110.138640.0003
XML
Image XML parsing0.00060.073620.0003
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00100.1159160.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs