HOWTO? from plain text to xmltext datatype ...

Author Message

Björn Dieding@xrow.de

Friday 30 July 2004 3:40:38 am

        include_once( "kernel/classes/datatypes/ezxmltext/handlers/input/ezsimplifiedxmlinput.php" );
        $simplifiedXMLInput = new eZSimplifiedXMLInput( $dumpdata, null, null );
		$address = "<line>bjoern dieding</line><line>asdasdasd</line><line>Germany</line>";
		
		$bodyData = "<section xmlns:image='http://ez.no/namespaces/ezpublish3/image/' xmlns:xhtml='http://ez.no/namespaces/ezpublish3/xhtml/' xmlns:custom='http://ez.no/namespaces/ezpublish3/custom/' >";
        $bodyData .= "<paragraph>";
        $bodyData .= $address;
        $bodyData .= "</paragraph>";
        $bodyData .= "</section>";
        $Data = $simplifiedXMLInput->convertInput( $bodyData );
        $xml = $Data[0]->toString();
        var_dump($xml);
        $data_map['address']->setAttribute( 'data_text', $xml );
        $data_map['address']->store();

What is the best way to turn any type text into the content of a xml text field?

I don't wanna have all the tags in my code! Any ideas?

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Bård Farstad

Wednesday 18 August 2004 12:09:14 am

The way you do it in the example above is ok. If you don't want to have the tags in your code you should look into using the XML dom structure.

--bård

Documentation: http://ez.no/doc

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 18:50:27
Script start
Timing: Jan 19 2025 18:50:27
Module start 'layout'
Timing: Jan 19 2025 18:50:27
Module start 'content'
Timing: Jan 19 2025 18:50:27
Module end 'content'
Timing: Jan 19 2025 18:50:27
Script end

Main resources:

Total runtime0.0143 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.2891152.6406
Module start 'layout' 0.00550.0030 741.929739.4766
Module start 'content' 0.00850.0040 781.406389.3984
Module end 'content' 0.01260.0017 870.804734.3047
Script end 0.0143  905.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.4650140.0002
Check MTime0.00106.8461140.0001
Mysql Total
Database connection0.00106.742610.0010
Mysqli_queries0.002517.469930.0008
Looping result0.00000.090110.0000
Template Total0.00149.810.0014
Template load0.00075.175010.0007
Template processing0.00074.614110.0007
Override
Cache load0.00053.675910.0005
General
dbfile0.00031.806380.0000
String conversion0.00000.063440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs