on 02-21-2019 7:44 AM
Hi,
I have a requirement where from source some pipe separated value is coming and we have to fetch it .
for e.g. If the value coming as 01|02|03|04|05
then the required value is(Separately ) - 01
02
03
04
05
is it possible to do in content modifier . if so then how o acieve this
or atleast we get "01" first value
Is this the expression you have?
substring-before{Root/Element/InputParameters "|"}
Note function-call format, it should have round brackets and a comma between params.
substring-before(Root/Element/InputParameters, "|")
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it is a CSV data then you can use CSV to XML converter to get the separated field values in the defined XML nodes. If further modification is required, you can use gsh/message mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
If message body is XML and this needs to be set as header/property in the content modifier,
You could use an XPATH condition in content modifier,
Action Name Type Data Type Value Default
Create Value1 XPATH String substring-before(<xpath to field>, "|")
Regards
Sanjali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
i am getting below error :
org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: substring-before{Root/Element/InputParameters "|"}. Reason: javax.xml.xpath.XPathExpressionException: net.sf.saxon.trans.XPathException: Node constructor expressions are allowed only in XQuery, not in XPath, cause: net.sf.saxon.trans.XPathException: Node constructor expressions are allowed only in XQuery, not in XPath
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.