1 package org.enhydra.jawe.xml; 2 3 import org.xml.sax.EntityResolver ; 4 import org.xml.sax.InputSource ; 5 6 import java.io.*; 7 8 12 public class XPDLEntityResolver implements EntityResolver { 13 14 public static final String XPDL_SCHEMA = "org/enhydra/jawe/resources/TC-1025_schema_10_xpdl.xsd"; 15 16 public InputSource resolveEntity (String publicId,String systemId) { 17 if (systemId!=null) { 19 return getSchemaInputSource(); 20 } else { 21 return null; 23 } 24 } 25 26 public static InputSource getSchemaInputSource () { 27 InputStream is=null; 28 try { 29 java.net.URL u= 30 XPDLEntityResolver.class.getClassLoader().getResource(XPDL_SCHEMA); 31 is=(InputStream)u.getContent(); 32 return new InputSource (is); 33 } catch (Exception ex) { 34 return null; 35 } 36 } 37 } 38 39 | Popular Tags |