Biri diğerinden içe aktarılan iki şema dosyasına sahibim. Eclipse şemalar kod bulunur yürütme ancak kavanoz şema dosyalarından kod yürütülürken bulunmayan zaman burada Kavanoz dosyası içindeki bir XSD şemasına başvurma
koduSAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
factory.setValidating(false);
SchemaFactory schemaFactory = SchemaFactory
.newInstance("http://www.w3.org/2001/XMLSchema");
try {
factory.setSchema(schemaFactory.newSchema(new Source[] {
new StreamSource(getClass().getResource("Liso.xsd")
.getFile()),
new StreamSource(getClass().getResource("LisoXml.xsd")
.getFile()) }));
this.saxParser = factory.newSAXParser();
} catch (SAXException se) {
System.out.println("SCHEMA : " + se.getMessage()); // problem in the XSD itself
}
ve burada hata ben
SCHEMA : schema_reference.4: Failed to read schema document 'file:/C:/Tools/lib/LisoTools.jar!/com/xerox/liso/xml/Liso.xsd', because 1) could not find the do
cument; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
olsun edilir Teşekkürler
İki yıl önce benzer bir sorun yaşadığımı hatırlıyorum: http://stackoverflow.com/questions/2065868/need-help-with-strange-classgetresource-issue - 'getRessource()' java 1.4.2 ile çalıştı java ile değil 1.6 ... –
Kavanozun/x/xerox/liso/xml/Liso.xsd' içermesi gerektiğini doğrulayın ve xsd gibi de görünüyor :) – rogerdpack