Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Generating XML
SandeepMadan
Hi,
I am generating XML from my tpl file. The problem is I want to add '<[CDATA[' tag in my XML body so generated. But this doesnt works as the Template removes the tag.
The code is as follows:
<iw_pt encoding="UTF-8" name="XML Generation Template"/>
<root>
<iw_iterate var="repeats" list="dcr._details">
<comp_details>
<outname><![CDATA[
<iw_value name="repeats.Comp_Details._compOutname"/>]]>
</outname>
<address>
<iw_value name="repeats.Comp_Details._compAddress"/>
</address>
<city> <iw_value name="repeats.Comp_Details._compCity"/> </city> <region> <iw_value name="dcr._region"/> </region> <postcode> <iw_value name="repeats.Comp_Details._compPostcode"/> </postcode> <supplier> <iw_if expr="{iw_value name='dcr._details.Comp_Details._compSupplier'} eq ''">
<iw_then> <iw_value name="repeats.Comp_Details._compOtSupplier"/> </iw_then> <iw_else> <iw_value name="repeats.Comp_Details._compSupplier"/> </iw_else>
</iw_if> </supplier> <market> <iw_value name="repeats.Comp_Details._compMkt"/> </market> <type> <iw_value name="repeats.Comp_Details._compType"/> </type> <size> <iw_value name="repeats.Comp_Details._compSize"/> </size> <gas> <iw_value name="repeats.Comp_Details._compGas"/> </gas> <equipment> <iw_value name="repeats.Comp_Details._compEquipment"/> </equipment> <consumables> <iw_value name="repeats.Comp_Details._compConsume"/> </consumables> <safety> <iw_value name="repeats.Comp_Details._compSafety"/> </safety> <ophrs> <iw_value name="repeats.Comp_Details._compOphrs"/> </ophrs> <phone> <iw_value name="repeats.Comp_Details._compPhone"/> </phone> <fax> <iw_value name="repeats.Comp_Details._compFax"/> </fax> </comp_details> </iw_iterate>
</root>
Can anyone pls let me know how to deal with the problem?????
Find more posts tagged with
Comments
Jeremy
Hi,
If I remember correctly we split it up into variables and printed those out.
Something like
$cd1 = '<[CD';
$cd2 = 'ATA[';
print $cd1.$cd2;
HTH.
Adam Stoller
Try changing:
<outname><![CDATA[
to
<outname><iw_perl>iwpt_output("<!["."CDATA[");</iw_perl>
or, if you're using strict, well-formed PTs:
<outname><iw_perl><![CDATA[iwpt_output("<!["."CDATA[");]]></iw_perl>
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
SandeepMadan
i feel it works...........
Thanks
SandeepMadan
Yes it works!!!!!!!
Thanks a tonn
)
Sandeep