На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
Модераторы: ANDLL
  
> Валидация XSD схемы , ошибки при валидации XSD схемы
    Подскажите пожалуйста как решить проблему с валидацие XSD. Использую программу XMLSpear, во время валидации получаю ошибки

    1. src-resolve.4.2: Error resolving component 'TypeOrganization'. It was detected that 'TypeOrganization' is in namespace 'moreq-ua.xsd', but components from this namespace are not referenceable from schema document 'file:///D:/Work/tmp/moreq-ua.xsd'. If this is the incorrect namespace, perhaps the prefix of 'TypeOrganization' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///D:/Work/tmp/moreq-ua.xsd'.

    2. src-resolve: Cannot resolve the name 'TypeDocType' to a(n) 'simpleType definition' component.

    3. src-resolve: Cannot resolve the name 'TypeCollection' to a(n) 'simpleType definition' component.

    4. src-resolve: Cannot resolve the name 'TypeDocType' to a(n) 'simpleType definition' component.

    5. src-resolve: Cannot resolve the name 'TypeCollection' to a(n) 'simpleType definition' component.

    6. s4s-att-invalid-value: Invalid attribute value for 'base' in element 'extension'. Recorded reason: UndeclaredPrefix: Cannot resolve 'define:TypeHeader_Base' as a QName: the prefix 'define' is not declared.

    7. s4s-att-must-appear: Attribute 'base' must appear in element 'extension'.

    в XSD не силен, по этому прошу помощи.

    В итоге мне надо будет получить XML по этой схеме...
      аттач к предыдущему посту. сори, забыл прикрепить. в аттаче собственно сама схема...
      Прикреплённый файлПрикреплённый файлmoreq_ua.zip (2,07 Кбайт, скачиваний: 261)
        ExpandedWrap disabled
          <xs:schema xmlns="moreq-ua.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="moreq-ua.xsd" targetNamespace="moreq-ua.xsd">


        Добавлено
        XMLSpy, кстати, сразу сказал "у тебя де не задан targetNamespace. Позволь, я отрублю ему голову сам создам его для тебя, о повелитель"
          Цитата ss @
          ExpandedWrap disabled
            <xs:schema xmlns="moreq-ua.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="moreq-ua.xsd" targetNamespace="moreq-ua.xsd">


          Добавлено
          XMLSpy, кстати, сразу сказал "у тебя де не задан targetNamespace. Позволь, я отрублю ему голову сам создам его для тебя, о повелитель"

          Спасибо большое :) осталось еще две ошибки

          1. [443:61]: s4s-att-invalid-value: Invalid attribute value for 'base' in element 'extension'. Recorded reason: UndeclaredPrefix: Cannot resolve 'define:TypeHeader_Base' as a QName: the prefix 'define' is not declared.

          2. [443:61]: s4s-att-must-appear: Attribute 'base' must appear in element 'extension'.

          Сейчас скачаю XMLSpy, может он подскажет решение :)
            Решение он не подскажет. Я подскажу: найди схему, в которой определён TypeHeader_Base, и заимпорть её + xmlns:define="<нэймспейс из той схемы>".
              Цитата ss @
              Решение он не подскажет. Я подскажу: найди схему, в которой определён TypeHeader_Base, и заимпорть её + xmlns:define="<нэймспейс из той схемы>".

              а я поубирал define в куске кода, где оно ругалось и ошибки пропали, потом сгенерировал XML. я не знаю правильно или нет. а зачем там define надо, в остальных местах в complexType нигде не юзается define...

              <xs:element name="Header">
              <xs:complexType>
              <xs:complexContent>
              <xs:extension base="TypeHeader_Base">
              <xs:sequence>
              <xs:element name="Document" type="TypeDocument" minOccurs="0"/>
              <xs:element name="TaskList" type="TypeTaskList" minOccurs="0"/>
              <xs:element name="AddDocuments" type="TypeAddDocuments" minOccurs="0"/>
              <xs:element name="Expansion" type="TypeExpansion" minOccurs="0"/>
              <xs:element name="Acknowledgement" type="TypeAcknowledgement" minOccurs="0"/>
              </xs:sequence>
              <xs:attribute name="msg_type" type="TypeMsgType" use="required"/>
              </xs:extension>
              </xs:complexContent>
              </xs:complexType>
              </xs:element>
              0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
              0 пользователей:


              Рейтинг@Mail.ru
              [ Script execution time: 0,0307 ]   [ 17 queries used ]   [ Generated: 14.05.24, 19:03 GMT ]