Author Topic

Betsy Gamrat

Monday 26 February 2007 10:17:58 am

Comment47833

I have had good luck with this approach, basically taking a text string and wrapping it with XML data.

I think if you ran the conversion code, then wrapped it with the XML tags, you would be okay.

$description = XML_wrap($Data);

function XML_wrap($text)
{
return '<?xml version="1.0" encoding="UTF-8"?>' ."\n".
                '<section xmlns:image="http://ez.no/namespaces/ezpublish3/image/"'."\n".
                '    xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/"'."\n".
                '    xmlns:custom="http://ez.no/namespaces/ezpublish3/custom/"><paragraph>'.
                $text."</paragraph>\n</section>\n";
}