Lowell

Get CDATA to stay in XOG output

Discussion created by Lowell on Oct 26, 2011
Latest reply on Nov 3, 2011 by Chris_Hackett
Hi All,
I'm trying to keep "CDATA" in the "XOG output" for my GEL script. The output appears to "strip" this out of it when it sends the XOG:

I convert the "name" using the "![CDATA[   ....  ]]>" When I get the Output of the script using "Serialize", the "![CDATA[   ....  ]]>" is not in the output.

<Description><![CDATA[${row1.level1_name}]]></Description>




"OBS Build" Below:


<gel:parse var="xogBody">
<NikuDataBus
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_department.xsd">
<Header action="write" externalSource="NIKU"
objectType="department" version="8.0.0.4088"/>
<Departments>
<core:forEach items="${v_obs1.rows}" trim="true" var="row1">
<gel:log level="INFO">Level1: Name: ${row1.level1_name} Code: ${row1.level1_code}</gel:log>
<Department
department_code="${row1.level1_code}"
dept_manager_code="admin"
entity="Regence" short_description="${row1.level1_name}">
<Description><![CDATA[${row1.level1_name}]]></Description>
<LocationAssociations>
<LocationAssociation locationcode="TRG"/>
</LocationAssociations>
<sql:query var="v_obs2">
SELECT distinct trim(a.level2_code) level2_code,
trim(a.level2_name)level2_name
FROM trg_dep_obs_import a
WHERE trim(a.level1_code) = '${row1.level1_code}' and a.level2_code is not null
ORDER BY trim(a.level2_code)
</sql:query>
<core:forEach items="${v_obs2.rows}"
trim="true" var="row2">
<gel:log level="INFO">Level2: Name: ${row2.level2_name} Code: ${row2.level2_code}</gel:log>
<gel:out>"${row2.level2_code}"</gel:out>
<Department
department_code="${row2.level2_code}"
dept_manager_code="admin"
entity="Regence" short_description="${row2.level2_name}">
<Description><![CDATA[${row2.level2_name}]]></Description>
<LocationAssociations>
<LocationAssociation locationcode="TRG"/>
</LocationAssociations>
<sql:query var="v_obs3">
SELECT distinct trim(a.level3_code) level3_code,
trim(a.level3_name) level3_name
FROM trg_dep_obs_import a
WHERE trim(a.level2_code) = '${row2.level2_code}' and a.level3_code is not null
ORDER BY trim(a.level3_code)
</sql:query>
<core:forEach
items="${v_obs3.rows}"
trim="true" var="row3">
<gel:log level="INFO">Level3: Name: ${row3.level3_name} Code: ${row3.level3_code}</gel:log>
<gel:out>"${row3.level3_code}"</gel:out>
<Department
department_code="${row3.level3_code}"
dept_manager_code="admin"
entity="Regence" short_description="${row3.level3_name}">
<Description><![CDATA[${row3.level3_name}]]></Description>
<LocationAssociations>
<LocationAssociation locationcode="TRG"/>
</LocationAssociations>
<sql:query var="v_obs4">
SELECT distinct trim(a.level4_code) level4_code,
trim(a.level4_name) level4_name
FROM trg_dep_obs_import a
WHERE trim(a.level3_code) = '${row3.level3_code}' and a.level4_code is not null
ORDER BY trim(a.level4_code)

</sql:query>
<core:forEach
items="${v_obs4.rows}"
trim="true" var="row4">
<gel:log level="INFO">Level4: Name: ${row4.level4_name} Code: ${row4.level4_code}</gel:log>
<gel:out>"${row4.level4_code}"</gel:out>
<Department
department_code="${row4.level4_code}"
dept_manager_code="admin"
entity="Regence" short_description="${row4.level4_name}">
<Description><![CDATA[${row4.level4_name}]]></Description>
<LocationAssociations>

<LocationAssociation locationcode="TRG"/>
</LocationAssociations>
</Department>
</core:forEach>
</Department>
</core:forEach>
</Department>
</core:forEach>
</Department>
</core:forEach>
</Departments>
</NikuDataBus>
</gel:parse>

Outcomes