DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=35560>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=35560 Summary: org.xml.sax.SAXParseException: General Schema Error: Product: Xerces-J Version: unspecified Platform: PC OS/Version: Windows Server 2003 Status: NEW Keywords: Xerces2 Severity: critical Priority: P1 Component: SAX AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] when the work dirctory including chinese character, DOMParse cannt parse the current path. for example: the current work dir : E:\н¨Îļþ¼Ð\eclipse the schema file : E:\н¨Îļþ¼Ð\eclipse\Model.xsd _code:_________________________________________________________________ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder domBuilder = domFactory.newDocumentBuilder(); Document document = domBuilder.parse(new File("Model.xml")); Element modelElement = document.getDocumentElement(); modelElement.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); modelElement.setAttribute("xsi:noNamespaceSchemaLocation", "Model.xsd"); StringReader sr = new StringReader(toXMLString(document, true)); InputSource is = new InputSource(sr); DOMParser domParser = new DOMParser(); domParser.setFeature("http://apache.org/xml/features/allow-java- encodings",true); domParser.setFeature("http://xml.org/sax/features/validation", true); domParser.setFeature("http://apache.org/xml/features/validation/schema", true); domParser.setFeature("http://apache.org/xml/features/validation/schema- full-checking", true); domParser.setErrorHandler(new ErrorHandler()); domParser.parse(is); sr.close(); ______________________________________________________________________ result: [Fatal Error] :0:0: File "Model.xsd" not found. org.xml.sax.SAXParseException: General Schema Error: Stopping after fatal error: File "Model.xsd" not found.. at org.apache.xerces.framework.XMLParser.reportError (XMLParser.java:1150) at org.apache.xerces.validators.common.XMLValidator.reportRecoverableXMLError (XMLValidator.java:1712) at org.apache.xerces.validators.common.XMLValidator.resolveSchemaGrammar (XMLValidator.java:2732) at org.apache.xerces.validators.common.XMLValidator.bindNamespacesToElementAndAttri butes(XMLValidator.java:2610) at org.apache.xerces.validators.common.XMLValidator.callStartElement (XMLValidator.java:1152) at org.apache.xerces.framework.XMLDocumentScanner.scanElement (XMLDocumentScanner.java:1862) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch (XMLDocumentScanner.java:1005) at org.apache.xerces.framework.XMLDocumentScanner.parseSome (XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035) at com.sitechasia.tools.service.ServiceMain.validateXML (ServiceMain.java:717) at com.sitechasia.tools.service.ServiceMain.main(ServiceMain.java:761) -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
