...
The Factory is discovered using this algorithm:
1. Use the javax.xml.stream.XMLInputFactory
, javax.xml.stream.XMLOutputFactory
system property.
2. Use the lib/xml.stream.properties
file in the JRE_HOME
directory.
3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLInputFactory
, META-INF/services/javax.xml.stream.XMLOutputFactory
files in jars available to the JRE.
4. Use the platform default XMLInputFactory,XMLOutputFactory instance.
How to set the XML encoding in Xstream DataFormat?
From Camel 1.6.3 or Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME
, or setting the encoding property on Xstream from DSL or Spring config.
Code Block |
---|
from("activemq:My.Queue").
marshal().xstream("UTF-8").
to("mqseries:Another.Queue");
|
Wiki Markup |
---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-xstream/src/test/resources/org/apache/camel/dataformat/xstream/SpringMarshalListTest.xml} |
Dependencies
To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format.
...