As I said previously, the local-name() function won't help you as it
operates on a nodeset. I suggested it because I thought your use case was
different.

The notation you are using: {namespace}local-name seems to be specific to
Java, so don't expect to find an XPath function to cover it.

You may look at implementing a simple regex expression to identify the
namespace and then use XPath 2.0 replace() function to get rid of it [1].

You will need to use Saxon for this, either via the XPath or XQuery
language. With XPath you will need to instruct Camel to use Saxon. The
XQuery language automatically uses Saxon.

Regards,
Raúl.

On 7 December 2011 20:15, MichaelAtSAG <mebevilac...@gmail.com> wrote:

> @Raul
>
> You are correct, my xpath did mix up the two event types in the xpath. The
> event type is PartInventoryShortage, the wrong path was used in the xpath
> and the wrong XSD was pasted above. Once the xpath was changed to proper
> path using PartInventoryShortage instead of PartInventoryLow, it worked!
>
> <setHeader headerName="SItemID">
>        <xpath
>
> resultType="java.lang.String">/evt:Event/evt:Body/pay:PartInventoryShortage/pay:Part/pay:ItemID</xpath>
> </setHeader>
>
> We have an urgent situation. We need ${body.DesiredInventoryLevel} piece(s)
> for item number ABC123, yet suppliers only have
> ${body.SupplierInventoryLevel} piece(s).
>
> Issue <1> solved!
>
> I also still want to retrieve only the local part of the event type name, I
> am still playing with the use of local-name() xpath function, but I
> continue
> to get Invalid xpath when I use any xpath function. I will open a different
> topic for this.
>
> Thank you Raul!!
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Velocity-without-java-tp5042885p5056836.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to