eZ Community » Forums » Developer » HTML to eZXML
expandshrink

HTML to eZXML

HTML to eZXML

Monday 11 December 2006 4:37:41 pm - 2 replies

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

Monday 11 December 2006 5:09:04 pm

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.

Sunday 17 December 2006 9: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

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from