FileOutputStream fos = null;
try {
XsObjectFactory factory = context.getXsObjectFactory();
XsSAXParser xsSAXParser = factory.newXsSAXParser();
context.setCurrentContentHandler(xsSAXParser);
XMLReader xr = factory.newXMLReader(isValidating());
String logDir = System.getProperty("org.apache.ws.jaxme.xs.logDir");
if (logDir != null) {
File tmpFile = File.createTempFile("jaxmexs", ".xsd", new File(logDir));
fos = new FileOutputStream(tmpFile);
LoggingContentHandler lch = new LoggingContentHandler(fos);