Hi Fuhwei, please can you confirm that this is what you are after :
A new JavaGenerator.OPTION_USE_STAX_PARSER which is then (obviously) honored in the XSD2JavaGenerator ?
And / or a new method similar to the following:
public static void generateFromXMLSchema(XMLStreamReader xsdSource, String namespace, String targetDirectory, String javaPackage, String prefix, int genOptions)
Whilst StAX should give improved performance of generation, I'm not sure about the overall benefit (versus effort of implementing). As I understand it, static generation is typically a development only activity, so it would not effect runtime performance - or do you have some very complex schemas that need frequent generation to static SDOs ?