我用javax.xml.parsers.DocumentBuilderFactory解析XML文件,并用schema进行文件格式验证。
大部分文件解析没有问题,但是当被读取的XML文件路径含有中文字符的时候,就抛出SAXException:schema_reference.4: Failed to read schema document 'my_schema_path\user_schema.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.请问各位有什么建议吗?谢谢!

解决方案 »

  1.   

    Failed to read schema document 'my_schema_path\user_schema.xsd',schema文件的问题?
    没看出来是XML文件中文名的问题 
      

  2.   

    这只是我举了个例子,例如我的schema文件是‘C:\schema.xsd’
    XML文件是'C:\myxml.xsd'谢谢!
      

  3.   

    lyboyc脑子有问题吧,你吧路径换成中文不就行了