Is is possible to output content of xml block as text

Author Message

Jose Mourinho

Wednesday 12 September 2007 10:54:45 am

Hello all

How can the content of xml block to be output as text? I want to extract the attribute of object which is an xml block and output it in title of html tag a
(in <a title="here I want to put the content of the xml bock" href="http://www.blabla.com"> link</a>)
Is there someway with raw output ... ?

10x to all

paul bolger

Wednesday 12 September 2007 4:15:50 pm

Hi Jose

You certainly can. But be aware that without stripping the XML tags you may end up with a pretty dirty title.

Try something like this.

{strip_tags( $node.data_map.intro.value.output.output_text ) | wash | shorten(80, '...', right)}

Paul Bolger

Damien Pobel

Thursday 13 September 2007 1:03:20 am

Hi Jose,

Some informations about this question : http://ez.no/community/forum/setup_design/getting_text_version_of_an_xml_blocks (my first post in this forum ;-))

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Fox Mulder

Thursday 13 September 2007 2:12:51 am

In my case I solve the problem with

$node.data_map.xml_block.content.output.output_text|striptags()|trim

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 18 2025 18:36:23
Script start
Timing: Jan 18 2025 18:36:23
Module start 'layout'
Timing: Jan 18 2025 18:36:23
Module start 'content'
Timing: Jan 18 2025 18:36:24
Module end 'content'
Timing: Jan 18 2025 18:36:24
Script end

Main resources:

Total runtime0.7275 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.1406152.6406
Module start 'layout' 0.00710.0027 740.781339.4766
Module start 'content' 0.00970.7157 780.2578615.4688
Module end 'content' 0.72550.0019 1,395.726612.1250
Script end 0.7274  1,407.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4628160.0002
Check MTime0.00140.1944160.0001
Mysql Total
Database connection0.00110.157210.0011
Mysqli_queries0.669692.0441640.0105
Looping result0.00080.1069620.0000
Template Total0.696895.820.3484
Template load0.00220.305820.0011
Template processing0.694695.476220.3473
Template load and register function0.00030.036410.0003
states
state_id_array0.00140.198410.0014
state_identifier_array0.00190.267120.0010
Override
Cache load0.00190.2559210.0001
Sytem overhead
Fetch class attribute can translate value0.00070.095740.0002
Fetch class attribute name0.00160.216260.0003
XML
Image XML parsing0.00170.229140.0004
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00120.1676220.0001
String conversion0.00000.001140.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs