AnsweredAssumed Answered

Catching attribute value with xpath

Question asked by martin.snizek on Mar 20, 2013
Latest reply on Dec 4, 2013 by vihari
I'm using XPath to catch values of attributes, but it gives me back name of attribute and its value. For example: finish="2013-01-21T00:00:00", but I'd expect "2013-01-21T00:00:00" or 2013-01-21T00:00:00
Here is my code, which I'm using:
<gel:forEach select="$dataexport/soapenv:Envelope/soapenv:Body/NikuDataBus/customObjectInstances/instance/CustomInformation/ColumnValue[@name='i_pfpp_skt']/tsvData/segment" var="this_record">

<gel:set var="date_finish" select="$this_record/@finish" asString="false"/>

<gel:set var="date_start" select="$this_record/@start" asString="false"/>

<gel:set var="segment_value" select="$this_record/@value" asString="false"/>

<gel:log category="XOG" level="INFO">

date_finish: ${date_finish}, date_start: ${date_start}, segment_value: ${segment_value}


<gel:parse var="segment">

<segment isDefaultSegment="false" finish="${date_finish}" start="${date_start}" value="${segment_value}" />


<gel:set insert="true" select="$xog_message/soapenv:Envelope/soapenv:Body/NikuDataBus/customObjectInstances/instance/CustomInformation/ColumnValue[@name='i_pfpp_skt']/tsvData" value="${segment}"/>
Variable this_record contains following data:
<segment finish="2013-01-21T00:00:00"
                            start="2013-01-21T00:00:00" value="1000.0"/>
Because of catching finish="2012-11-07T00:00:00" instead of the date value I have a problem with parsing the segment. I also tried to parse the segment as:
<segment isDefaultSegment="false" "${date_finish}" "${date_start}" "${segment_value}" />
<segment isDefaultSegment="false" ${date_finish} ${date_start} ${segment_value} />
but when I use this, then Clarity throws error while saving the script. Error is BPM-0703: Custom script syntax error at line 151, column 38: Element type "segment" must be followed by either attribute specifications, ">" or "/>".
I'll appriciate all answers and ideas how to solve this.