tags:

views:

78

answers:

2

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
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