Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[3.22.68.49] |
|
Сообщ.
#1
,
|
|
|
Подскажите пожалуйста как решить проблему с валидацие 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 по этой схеме... |
Сообщ.
#2
,
|
|
|
аттач к предыдущему посту. сори, забыл прикрепить. в аттаче собственно сама схема...
Прикреплённый файлmoreq_ua.zip (2,07 Кбайт, скачиваний: 261) |
Сообщ.
#3
,
|
|
|
<xs:schema xmlns="moreq-ua.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="moreq-ua.xsd" targetNamespace="moreq-ua.xsd"> Добавлено XMLSpy, кстати, сразу сказал "у тебя де не задан targetNamespace. Позволь, я |
Сообщ.
#4
,
|
|
|
Цитата ss @ <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, может он подскажет решение |
Сообщ.
#5
,
|
|
|
Решение он не подскажет. Я подскажу: найди схему, в которой определён TypeHeader_Base, и заимпорть её + xmlns:define="<нэймспейс из той схемы>".
|
Сообщ.
#6
,
|
|
|
Цитата 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> |