Hello,
When trying to use the Velocity component I encountered a problem.
I have a Simple SQL query I would like to built using the Message Body (XML)
I was using an XSL file to perform the transformation by extracting the
values into the SQL query templace.
<xsl:template match="/">INSERT INTO person VALUES('<xsl:value-of
select="ns0:person/ns0:username"/>','<xsl:value-of
select="ns0:person/ns0:firstName"/>','<xsl:value-of
select="ns0:person/ns0:lastName"/>','<xsl:value-of
select="ns0:person/ns0:mailAddress"/>','<xsl:value-of
select="ns0:person/ns0:password"/>','<xsl:value-of
select="ns0:person/ns0:address/ns0:zipCode"/>','<xsl:value-of
select="ns0:person/ns0:socialId"/>')</xsl:template>
However I think using Velocity would be easier to understand.
Is there a way to using the ${body.<xpath>} placeholder in the velocity
template? because at the moment I use the headers, which works, but is not
really practical for larger files.
Here is my expected VM file
INSERT INTO person
VALUES('${body.ns0:person/ns0:username}','${body.ns0:person/ns0:firstName}','${body.ns0:person/ns0:lastName}','${body.ns0:person/ns0:mailAddress}','${body.ns0:person/ns0:password}','${body.ns0:person/ns0:address/ns0:zipCode}','${body.ns0:person/ns0:socialId}')
I am also intressted in any other way to use the body values.
Thanks in avance,
Olivier
--
View this message in context:
http://old.nabble.com/Velocity-component-tp28287678p28287678.html
Sent from the Camel - Users mailing list archive at Nabble.com.