camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gert Vanthienen (JIRA)" <j...@apache.org>
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

    [ https://issues.apache.org/activemq/browse/CAMEL-2669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59279#action_59279
] 

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.  

{noformat}
Index: src/test/java/org/apache/camel/component/file/XPathToFileTest.java
===================================================================
--- src/test/java/org/apache/camel/component/file/XPathToFileTest.java	(revision 942839)
+++ src/test/java/org/apache/camel/component/file/XPathToFileTest.java	(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,
first));
 
         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,
second));
     }
{noformat}

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: https://issues.apache.org/activemq/browse/CAMEL-2669
>             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
> http://old.nabble.com/XPath-Splitter-Problem-ts28325959.html
> 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.


Mime
View raw message