4 messages in com.googlegroups.bloggerdev[bloggerDev] Re: must be terminated b...
FromSent OnAttachments
Benedict28 Jul 2008 01:37 
Trevor Johns28 Jul 2008 01:46 
Benedict28 Jul 2008 01:53 
Trevor Johns28 Jul 2008 02:00 
Subject:[bloggerDev] Re: must be terminated by the matching end-tag
From:Trevor Johns (tjo@google.com)
Date:07/28/2008 01:46:43 AM
List:com.googlegroups.bloggerdev

Hi Benedict, I suggest looking at Tidy. It's a very useful program that will fix up these sorts of errors automatically (plus a lot of other useful features). There's even a PHP binding, so you can call it directly from your code.

http://tidy.sourceforge.net/ http://php.net/tidy

On 7/28/08, Benedict <bene@gmail.com> wrote:

Hi, uhmm.. Im trying to do crossposting from wordpress to blogger using gdata blogger api, but once I've send my request, an error like this appears.

"The element type &quot;img&quot; must be terminated by the matching end-tag &quot;&lt;/img&gt;&quot;"

I am aware that the fix to this is to place a '/' at the end of the image tag. but is there another way to fix this?

What I am doing is that I am trying to crosspost after I've published a new post from wordpress. Aside from doing this

i can do this code to fix my content $content = preg_replace ("/<img(.*)>/sU","<img\\1/>",$content);

but what if there are still other unterminated tags? I cant do preg_replace for every existing unterminated tags because It will slow down my crossposting process.

btw. this is the example of my xml

<entry xmlns='http://www.w3.org/2005/Atom'> <title type='text'>$title</title> <content type='xhtml'> $content </content> </entry>"

its content type is xhtml, I've also tried content type html and text and it returns a different error. It doesnt recognize my other tags such as 'p' etc...

Can you guys suggest any fix?

Thanks.. Benedict