1 package com.thaiopensource.validate.schematron;2 3 import com.thaiopensource.validate.IncorrectSchemaException;4 import com.thaiopensource.validate.Option;5 import com.thaiopensource.validate.SchemaReader;6 import com.thaiopensource.validate.SchemaReaderFactory;7 8 import javax.xml.transform.TransformerConfigurationException ;9 import javax.xml.transform.TransformerFactory ;10 import javax.xml.transform.TransformerFactoryConfigurationError ;11 12 public abstract class SchematronSchemaReaderFactory implements SchemaReaderFactory {13 public SchemaReader createSchemaReader(String namespaceUri) {14 if (namespaceUri.equals(SchemaReaderImpl.SCHEMATRON_URI)) {15 try {16 return new SchemaReaderImpl(newTransformerFactory());17 }18 catch (TransformerFactoryConfigurationError e) { }19 catch (IncorrectSchemaException e) { }20 catch (TransformerConfigurationException e) { }21 }22 return null;23 }24 25 public Option getOption(String uri) {26 return SchematronProperty.getOption(uri);27 }28 29 public abstract TransformerFactory newTransformerFactory();30 }31