AnsweredAssumed Answered

How read custom attribute values from xml by using Gel?

Question asked by senthi on Aug 4, 2011
Latest reply on Jun 7, 2016 by karthikeyan.r.1
Hi,

I want to read the particular values from xml file by using GEL Script.

Example:


<gel:script xmlns:core="jelly:core"
xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:sql="jelly:sql" xmlns:util="jelly:util"
xmlns:j="jelly:core"

xmlns:xog="http://www.niku.com/xog"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<gel:parse var="DPH_READ">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
<Header action="write" externalSource="NIKU"
objectType="customObjectInstance" version="12.0.1.5063"/>
<customObjectInstances objectCode="amd_demand_plan">
<instance objectCode="amd_demand_plan"
parentInstanceCode="PRJ-101159" parentObjectCode="project">
<CustomInformation>
<ColumnValue name="code">DPH00000004</ColumnValue>
<ColumnValue name="amd_description">CAS Admin - 08/02/2011 - 8:21AM</ColumnValue>
<ColumnValue name="name">CAS Admin - 08/02/2011 - 8:21AM</ColumnValue>
<ColumnValue name="amd_status">Unapproved</ColumnValue>
<ColumnValue name="odf_cncrt_parent_id">5004105</ColumnValue>
<ColumnValue name="odf_parent_id">5004105</ColumnValue>
<ColumnValue name="partition_code">amd_eng</ColumnValue>
</CustomInformation>
</instance>
</customObjectInstances>
</NikuDataBus>


<gel:set select="$DPH_READ/NikuDataBus/customObjectInstances/instance/CustomInformation/ColumnValue" var="test"/>

<gel:set asString="true"
select="$test/@name" var="v_name"/>



<gel:log>
<gel:expr select="$DPH_READ"/>
</gel:log>
<gel:log>${v_name}</gel:log>

</gel:parse>




how can i read the code name (DPH00000004) from the above script ?


Now i am getting only attribute name (code)

Please let me know, how to achive?

Thanks
Senthi

Outcomes