Forums / Developer / HTML to eZXML

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