I want to use a fast pull parser for XStream's reading, but the default pull parser from Java 6. (Not DOM!) What do I have to do?
A:
Pass the appropriate driver to the XStream constructor:
XStream xs = new XStream(new StaxDriver());
String xml = xs.toXML(someObject);
Holger Hoffstätte
2010-08-03 00:11:37
A:
Probably you want to reduce the dependencies to jar files but from my oservation the XppDriver
performs better than the StaxDriver
. So if you need higher parsing speed just go with the default. Maybe others made different observations.
Christian Ullenboom
2010-08-18 08:35:11