You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2008/03/06 13:17:58 UTC

svn commit: r634241 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java

Author: jstrachan
Date: Thu Mar  6 04:17:56 2008
New Revision: 634241

URL: http://svn.apache.org/viewvc?rev=634241&view=rev
Log:
update the XmlConverter to avoid using String -> bytes[] conversions as per Arjan's suggestion:  http://www.nabble.com/XMLConverter-and-default-charset-tp15871372s22882p15871372.html

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java?rev=634241&r1=634240&r2=634241&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java Thu Mar  6 04:17:56 2008
@@ -482,6 +482,17 @@
     }
 
     /**
+     * Converts the given {@link InputStream} to a DOM document
+     *
+     * @param in is the data to be parsed
+     * @return the parsed document
+     */
+    @Converter
+    public Document toDOMDocument(Reader in) throws IOException, SAXException, ParserConfigurationException {
+        return toDOMDocument(new InputSource(in));
+    }
+
+    /**
      * Converts the given {@link InputSource} to a DOM document
      *
      * @param in is the data to be parsed
@@ -501,7 +512,7 @@
      */
     @Converter
     public Document toDOMDocument(String text) throws IOException, SAXException, ParserConfigurationException {
-        return toDOMDocument(text.getBytes());
+        return toDOMDocument(new StringReader(text));
     }
 
     /**