Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Не совсем понятно с XML-схемой / 1 сообщений из 1, страница 1 из 1
13.08.2006, 07:37
    #33914827
artgonch
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Не совсем понятно с XML-схемой
Здравствуйте!
Сделал простую XML-схему и на ее основе создал XML-документ. Вот они:
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
<?xml version="1.0" encoding="windows-1251" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.example.org"
            targetNamespace="http://www.example.org"
            elementFormDefault="qualified">
  <xsd:element name="records">
    <xsd:annotation>
      <xsd:documentation>
        Contains list of records
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>
            Date format: YYYY-MM-DD
            Time format: HH:mm:SS
          </xsd:documentation>
        </xsd:annotation>
        <xsd:element name="record">
          <xsd:annotation>
            <xsd:documentation>
              Represents one record
            </xsd:documentation>
          </xsd:annotation>
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="descriptor-set">
                <xsd:complexType>
                  <xsd:sequence maxOccurs="unbounded">
                    <xsd:element name="descriptor" type="xsd:string">
                      <xsd:complexType>
                        <xsd:attribute name="descriptor-type" type="xsd:string"
                                       use="required"/>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="source" type="xsd:string" minOccurs="0"/>
              <xsd:element name="source-article" type="xsd:string" maxOccurs="1"
                           minOccurs="0"/>
              <xsd:element name="expert" type="xsd:string"/>
              <xsd:element name="operator" type="xsd:string"/>
              <xsd:element name="article" type="xsd:string"/>
              <xsd:element name="multomedia" minOccurs="0">
                <xsd:annotation>
                  <xsd:documentation>
                    Contains links to attached multimedia files (pictures,
                    souds, movies)
                  </xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                  <xsd:sequence maxOccurs="unbounded">
                    <xsd:element name="file">
                      <xsd:complexType>
                        <xsd:simpleContent>
                          <xsd:extension base="xsd:string">
                            <xsd:attribute name="type" type="xsd:string"
                                           default="sound"/>
                          </xsd:extension>
                        </xsd:simpleContent>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
            <xsd:attribute name="creation-date" type="xsd:date"
                           use="required"/>
            <xsd:attribute name="creation-time" use="required" type="xsd:time"/>
            <xsd:attribute name="number" use="required" type="xsd:integer"/>
            <xsd:attribute name="id" type="xsd:integer"/>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
<?xml version="1.0" encoding="UTF-8" ?>
<records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.example.org XML/database.xsd"
         xmlns="http://www.example.org">
  <record creation-date="2002-11-09" creation-time="22:03:00" number="21510">
    <descriptor-set>
      <descriptor descriptor-type="*">Звук</descriptor>
      <descriptor descriptor-type="*">Форма</descriptor>
      <descriptor descriptor-type="#">Флоренский П.А.</descriptor>
    </descriptor-set>
    <source>У водоразделов мысли. М.,  1990 , с.  258 .</source>
    <expert>Егоров А.Г.</expert>
    <operator>Егоров А.Г.</operator>
    <article>... есть индивидуальная звуковая форма, как некоторая объективная сила, как то главное, что дает восприятие слуховое, что организует звук и сплачивает звуковые элементы, чем бы они ни были, в единое целое, и это целое, раз произведенное, устойчиво пребывает в мире, как некоторый индивидуум, как некоторый организм.</article>
  </record>
</records>

Однако при валидации выдается сообщение: Атрибут descriptor-type для элемента descriptor не определен. Использую Oracle XDK из JDev 10g. В чем может быть проблема?
Заранее спасибо.
...
Рейтинг: 0 / 0
Форумы / XML, XSL, XPath, XQuery [игнор отключен] [закрыт для гостей] / Не совсем понятно с XML-схемой / 1 сообщений из 1, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]