2012-06-08 2 views
4

У меня есть файл с именем jvxml-implementation-0-7.xsd в моем проекте.Корневой элемент документа не <xsd:schema>

Содержимое файла являются

<?xml version="1.0" encoding="UTF-8"?> 
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" 
xmlns="http://www.jvoicexml.org/xsd/jvxml-implementation-0-7.xsd" 
    xmlns:tns="http://www.example.org/jvxml-implementation"  
xmlns:beans="http://www.springframework.org/schema/beans" 
    elementFormDefault="qualified"> 
    <xsi:import namespace="http://www.springframework.org/schema/beans" 
    schemaLocation="spring-beans-2.0.xsd" /> 
    <xsi:element name="implementation"> 
    <xsi:annotation> 
     <xsi:documentation> 
    Implementation platform for JVoiceXML 
    </xsi:documentation> 
</xsi:annotation> 
<xsi:complexType> 
    <xsi:sequence minOccurs="0" maxOccurs="unbounded"> 
    <xsi:element name="repository" type="xsi:string" 
     minOccurs="0" maxOccurs="1"> 
     <xsi:annotation> 
     <xsi:documentation> 
      The name of the loader repository. 
     </xsi:documentation> 
     </xsi:annotation> 
    </xsi:element> 
    <xsi:element name="classpath" type="xsi:string" 
     minOccurs="0" maxOccurs="unbounded"> 
     <xsi:annotation> 
     <xsi:documentation> 
      Entry to be added to the CLASSPATH when 
      loading this implementation platform^M 
     </xsi:documentation> 
     </xsi:annotation> 
    </xsi:element> 
    <xsi:element ref="beans:bean" minOccurs="1" 
     maxOccurs="unbounded"> 
     <xsi:annotation> 
     <xsi:documentation>Spring bean configuration 
     </xsi:documentation> 
     </xsi:annotation> 
    </xsi:element> 
    </xsi:sequence> 
</xsi:complexType> 

Но при его загрузке происходит такая ошибка.

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jvxml-implementation-0-7.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>. 

Я изменил разрешение и поместил файл, в котором он находится. Поэтому я остался с третьей ошибкой.

Пожалуйста, дайте мне понять, как с этим бороться.

С уважением.

+0

HTTP: // SourceForge .net/проекты/jvoicexml/forums/forum/435548/topic/5238971 – duffymo

ответ

3

XSI - ссылка на экземпляр схемы - не схема.

1 из 2 вещей будут работать здесь.

  1. Изменение <xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" в <xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

ИЛИ

  1. Изменение <xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" к <xsd:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" и заменить все "XSI" с "XSD"
+0

Я хотел бы добавить здесь небольшую точку, я столкнулся с той же проблемой, но то, что я пропустил, было неправильным файловым файлом как для XSD, так и для XML. , пожалуйста, не будьте идиотом, как я, как выше. –

Смежные вопросы