コード例 #1
0
 private Schema getMappingSchema() {
   ClassLoader loader = ReflectionHelper.getClassLoaderFromClass(XmlMappingParser.class);
   URL schemaUrl = loader.getResource(VALIDATION_MAPPING_XSD);
   SchemaFactory sf = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
   Schema schema = null;
   try {
     schema = sf.newSchema(schemaUrl);
   } catch (SAXException e) {
     log.unableToCreateSchema(VALIDATION_MAPPING_XSD, e.getMessage());
   }
   return schema;
 }