camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r634241 - /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
Date Thu, 06 Mar 2008 12:17:58 GMT
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));
     }
 
     /**



Mime
View raw message