The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

OrBee (61) [Avatar] Offline
#1
I have an expression such as the following which evaluates to a text string

#[xpath('/process/processId/text()'.text) ] I want to use this value as

insert into processInfo(processId,processName) values(#[xpath('/process/processId/text()'.text) ],processName)

However, the xml value for the processId should be an integer. How can I convert the value to an integer?

#[integersmiliepath('/process/processId/text()'.text) ] , this doesn't work.
David Dossot (233) [Avatar] Offline
#2
Re: getting integer from xpath expression
Use:

#[Integer.valueOf(xpath('/process/processId/text()'.text))]

MEL, being MVEL, has access to all the JDK.
David Dossot (233) [Avatar] Offline
#3
Re: getting integer from xpath expression
Also please note that this forum is for discussing questions related to the book (i.e. typos. lack of clarity, issue with an example, errors...) not general Mule questions.

Please ask general Mule questions to either http://forum.mulesoft.org or http://stackoverflow.com/questions/tagged/mule

Thank you!