Problems inserting into $dataMap

Problems inserting into $dataMap

Monday 26 February 2007 6:19:00 am - 3 replies

Modified on Monday 26 February 2007 6:19:50 am by Bjarte Lunde

Author Message

Betsy Gamrat

Monday 26 February 2007 10:17:58 am

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";
}

Bjarte Lunde

Monday 26 February 2007 2:24:57 pm

I tried your suggestion, but it didn't do the trick.

I also have this code which inserts with no problem into a xml-block

    $equipment = '<ul>';
    $eqChild = $attributes->elementChildrenByName( 'EQUIPMENT' );
    foreach( $eqChild as $eqElement )
    {
        $equipment = $equipment.'<li>'.trim( $eqElement->textContent() ).'</li>';
    }
    $equipment = $equipment.'</ul>';
    $dataMap['equipment']->setAttribute( 'data_text', $equipment );
    $dataMap['equipment']->store();

Betsy Gamrat

Tuesday 27 February 2007 7:22:59 pm

It may be the <b><br></b> tags. You might want to try using a different substitution just to test the idea. For example, use <b>!</b>, just as a marker.

I don't think all versions of eZ support <b><br></b>.

Good luck.

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.