XHTML to XMLData

Author Message

Sébastien Morel

Tuesday 13 February 2007 7:42:25 am

Hello,

How transform a XHTML content to an XMLData content for the data_text field ?

I have generated a export XHTML of a attribute ezxmltext but I would to reimport this content in an ezpublish.

But I can't convert my XHTML in XMLData for eZ. I try this :

$parser = new eZSimplifiedXMLInputParser( null, false, 0, false );
$attributeValue = str_replace( "\r", '', $buffer );
$attributeValue = str_replace( "\n", '', $buffer );
$attributeValue = str_replace( "\t", ' ', $buffer );
$document = $parser->process( $attributeValue );
$description = eZXMLTextType::domString( $document );
$attribute->setAttribute( 'data_text', $description );
$attribute->store();

In my XHTML content I have a h5 tag and after the import the h5 isn't convert in "header" tag..

Thanks for your help

Séb

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

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

eZ debug

Timing: Jan 19 2025 05:11:36
Script start
Timing: Jan 19 2025 05:11:36
Module start 'layout'
Timing: Jan 19 2025 05:11:36
Module start 'content'
Timing: Jan 19 2025 05:11:37
Module end 'content'
Timing: Jan 19 2025 05:11:37
Script end

Main resources:

Total runtime0.9815 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.0391152.6094
Module start 'layout' 0.00660.0035 741.648439.4141
Module start 'content' 0.01010.9703 781.0625470.0391
Module end 'content' 0.98030.0012 1,251.10168.1875
Script end 0.9815  1,259.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3656160.0002
Check MTime0.00160.1613160.0001
Mysql Total
Database connection0.00070.074810.0007
Mysqli_queries0.934695.2189460.0203
Looping result0.00030.0340440.0000
Template Total0.948796.720.4744
Template load0.00190.197520.0010
Template processing0.946896.459620.4734
Template load and register function0.00010.011410.0001
states
state_id_array0.00080.083810.0008
state_identifier_array0.00100.100320.0005
Override
Cache load0.00160.1625120.0001
Sytem overhead
Fetch class attribute can translate value0.00100.102010.0010
Fetch class attribute name0.00050.051520.0003
XML
Image XML parsing0.00150.157110.0015
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00190.1891160.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs