You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Gerald Tarcisius <gt...@yahoo.com> on 2002/09/24 20:00:21 UTC
Problem with xerces and BPEL
I'm using the following code to verify a BPEL document
(it validates correctly using the web-based validator
on the w3c xml schema site):
import org.apache.xerces.parsers.SAXParser;
import org.xml.sax.Attributes;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
import org.xml.sax.ErrorHandler;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.ContentHandler;
import org.xml.sax.*;
public class Verify{
public static void main(String[] args) {
try {
// Create the parser.
XMLReader parser = XMLReaderFactory.createXMLReader
("org.apache.xerces.parsers.SAXParser");
parser.setFeature("http://xml.org/sax/features/validation",
true);
parser.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
true);
ErrorHandler errorhandler = new MyErrorHandler();
parser.setErrorHandler (errorhandler);
ContentHandler contenthandler = new
MyContentHandler();
parser.setContentHandler (contenthandler);
System.out.println (args[0]);
parser.parse("file:///" + args[0]);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
And I get the following error:
[Warning] :0:0: File "" not found.
org.xml.sax.SAXException: Stopping after fatal error:
File "" not found.
at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1228
)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
nt(DefaultEntityHandler.java:499)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
12)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1080)
at
org.apache.xerces.validators.schema.TraverseSchema.traverseImport(Tra
verseSchema.java:2016)
at
org.apache.xerces.validators.schema.TraverseSchema.doTraverseSchema(T
raverseSchema.java:698)
at
org.apache.xerces.validators.schema.TraverseSchema.<init>(TraverseSch
ema.java:518)
at
org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar
(XMLValidator.java:2753)
at
org.apache.xerces.validators.common.XMLValidator.parseSchemas(XMLVali
dator.java:2648)
at
org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElem
entAndAttributes(XMLValidator.java:2589)
at
org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java:1142)
at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1862)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1005)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1122)
at Verify.main(Verify.java:34)
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org