I want to obtain the string value of an XML element in the message. Are these
two Spring XML expressions functionality equivalent? 

--Camel--
(1)
<setHeader headerName="SevtType1">
        <xpath 
resultType="java.lang.String">/evt:Event/evt:Header/evt:Type</xpath>
</setHeader>

(2)
<setHeader headerName="SevtType2">
        <xpath >/evt:Event/evt:Header/evt:Type/text()</xpath>
</setHeader>

--Velocity--

Event1 = '${headers.SevtType1}'. 
Event2 = '${headers.SevtType2}'. 

I receive different results when I reference them in velocity

--Velocity output--
(1) SevtType1 is Correct : 
Event1 =
'{http://namespaces.softwareag.com/EDA/WebM/Sample/InventoryMgmt/1.0}PartInventoryShortage'

(2) SevtType2 is Incorrect:
Event2 = 
'com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@55e03a61'


--XML--
---<?xml version="1.0" encoding="UTF-8"?>
<evt:Event xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:evt="http://namespaces.softwareag.com/EDA/Event";>
    <evt:Header>
       
<evt:Type>{http://namespaces.softwareag.com/EDA/WebM/Sample/InventoryMgmt/1.0}PartInventoryShortage</evt:Type>
    </evt:Header>
</evt:Event>


My root issue is that I want to obtain the local name of
'PartInventoryShortage', yet the functions do not appear to be working in
XPATH.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Equivalent-expressions-tp5056482p5056482.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to