SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
factory.setResourceResolver(new ResourceResolver());
Source schemaFile = new StreamSource('Input stream with my xsd');
factory.newSchema(schemaFile);
마지막 줄 - factory.newSchema (schemaFile); soap-enc 네임 스페이스를 사용하는 xsd 파일을 사용할 때 예외 및 예외가 발생합니다. 아래는 xsd 파일의 일부, 네임 스페이스 선언 및 네임 스페이스를 사용하는 복합 유형입니다.
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/">
<xsd:complexType name="name">
<xsd:sequence>
<xsd:element name="id" type="xsd:string"/>
<xsd:element name="names" type="soap-enc:Array"/>
</xsd:sequence>
</xsd:complexType>
는 예외입니다 :이 스키마 파일에 정의되지 않은 배열 : org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 62; src-resolve.4.2: Error resolving component 'soap-enc:Array'. It was detected that 'soap-enc:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'null'. If this is the incorrect namespace, perhaps the prefix of 'soap-enc:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'null'.