camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siano, Stephan" <stephan.si...@sap.com>
Subject RE: camel - xml
Date Wed, 26 Nov 2014 07:39:10 GMT
"/row/EMPNO/text()), String.class" is really not a valid XPath. You probably want to terminate
the String before the comma...

-----Original Message-----
From: smilevasu6 [mailto:srinivas.thunga@gmail.com] 
Sent: Mittwoch, 26. November 2014 08:21
To: users@camel.apache.org
Subject: camel - xml

Hi,

I am having xml data like 

<results>
	<row>
		<EMPNO>7369</EMPNO>
		<ENAME>SMITH</ENAME>
		<SAL>800</SAL>
		<DEPTNO>10</DEPTNO>
	</row>
	<row>
		<EMPNO>7499</EMPNO>
		<ENAME>SMITH></ENAME>
		<SAL>1600</SAL>
		<DEPTNO>20</DEPTNO>
	</row>
	<row>
		<EMPNO>7521</EMPNO>
		<ENAME>SMITH</ENAME>
		<SAL>1250</SAL>
		<DEPTNO>30</DEPTNO>
	</row>
	<row>
		<EMPNO>7566</EMPNO>
		<ENAME>SMITH</ENAME>
		<SAL>2975</SAL>
		<DEPTNO>20</DEPTNO>
	</row>
</results>


I am writing  a camel router like,

from("file:C://Sri/?fileName=table_export_new.xml").
		//to("file:C://Sri/table_export_new.xml").
		setHeader("results", xpath("/row/EMPNO/text()), String.class")).
		setHeader("results", xpath("/row/ENAME/text()), String.class")).
		setHeader("results", xpath("/row/SAL/text()), String.class")).
		setHeader("results", xpath("/row/DEPTNO/text()), String.class"))
	//.convertBodyTo(String.class)
		.end();

And i am getting error as 

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid
xpath:/row/EMPNO/text()), String.class. Reason:
javax.xml.xpath.XPathExpressionException

Can you please help me on this?

After this i want to put the data into database as well.

Please 




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

Mime
View raw message