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