camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gert Vanthienen (JIRA)" <>
Subject [jira] Commented: (CAMEL-2669) XPath - Add type converters from the pesky XPath types to String, InputStream etc.
Date Tue, 11 May 2010 06:55:40 GMT


Gert Vanthienen commented on CAMEL-2669:

When I look at the XPathToFileTest, I would have expected it to behave differently, outputting
the XML element selected by the xpath expression instead of only the text node values.  

Index: src/test/java/org/apache/camel/component/file/
--- src/test/java/org/apache/camel/component/file/	(revision 942839)
+++ src/test/java/org/apache/camel/component/file/	(working copy)
@@ -51,11 +51,11 @@
         File first = new File("target/xpath/xpath-0.xml").getAbsoluteFile();
         assertTrue("File xpath-0.xml should exists", first.exists());
-        assertEquals("Claus", context.getTypeConverter().convertTo(String.class, first));
+        assertEquals("<person>Claus</person>", context.getTypeConverter().convertTo(String.class,
         File second = new File("target/xpath/xpath-1.xml").getAbsoluteFile();
         assertTrue("File xpath-1.xml should exists", second.exists());
-        assertEquals("Jonathan", context.getTypeConverter().convertTo(String.class, second));
+        assertEquals("<person>Jonathan</person>", context.getTypeConverter().convertTo(String.class,

If you do a {{convertBodyTo(String.class)}} after the splitter but before sending the contents
to a file, this is what happens, but the implicit conversion to InputStream that is being
used in the file: endpoint seems to drop the {{<element/>}}s

> XPath - Add type converters from the pesky XPath types to String, InputStream etc.
> ----------------------------------------------------------------------------------
>                 Key: CAMEL-2669
>                 URL:
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.0.0, 2.1.0, 2.2.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.3.0
> See nabble
> Then its easier for Camel end users as they wont have as many problems with the bad XPath
result types for NODESET and whatnot.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message