Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Handle xml fields in eZ Publish
function handleXmlField($bodyXml, $parser="simple")
$parser = new eZSimplifiedXMLInputParser(null);
if ($parser == 'oe') {
$parser = new eZOEInputParser(null);
$document = $parser->process($bodyXml);
if (!is_object($document)) {
$document = $parser->createRootNode();
$result = eZXMLTextType::domString($document);
$result = str_replace('<section xmlns:image="" xmlns:xhtml="" xmlns:custom=""/>', '', $result);
return $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment