|
не получается задать уникальность
|
|||
---|---|---|---|
#18+
помогите найти ошибку пытаюс сделать уникальным поле id в итоге ставлю в хml 2 одинаковых айдишника и это валидируется без ошибок(( почему? XSD <?xml version="1.0" encoding="UTF-8"?> <schema xmlns=" http://www.w3.org/2001/XMLSchema" targetNamespace=" http://www.example.com/" xmlns:tns=" http://www.example.com/"> <element name="trains"> <complexType> <sequence> <element name="train" type="tns:Train" minOccurs="1" maxOccurs="unbounded" /> </sequence> </complexType> <unique name="uniqueId"> <selector xpath="trains/Train"/> <field xpath="@id"/> </unique> </element> <complexType name="Train"> <sequence> <element name="traintype" type="tns:TrainType" /> </sequence> <attribute name="id" type="integer" use="required" /> <attribute name="propulsion" type="tns:Propulsion" use="required" /> </complexType> <complexType name="TrainType"> <sequence> <element name="countpassengers" type="tns:CountPassengers" /> <element name="routname" type="tns:Routs" /> </sequence> </complexType> <simpleType name="Routs"> <restriction base="string"> <enumeration value="Brest-Minsk"/> <enumeration value="Minsk-Moscow"/> <enumeration value="Moscow-Piter"/> </restriction> </simpleType> <simpleType name="CountPassengers"> <restriction base="integer"> <minInclusive value="50"/> <maxInclusive value="500"/> </restriction> </simpleType> <simpleType name="Propulsion"> <restriction base="string"> <enumeration value="Diesel"/> <enumeration value="Electric"/> <enumeration value="SteamLocomotive"/> </restriction> </simpleType> </schema> xml <?xml version="1.0" encoding="UTF-8"?> <tns:trains xmlns:tns=" http://www.example.com/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.example.com/ CommuterTrain.xsd "> <train id="1" propulsion="Diesel"> <traintype> <countpassengers>100</countpassengers> <routname>Brest-Minsk</routname> </traintype> </train> <train id="1" propulsion="Electric"> <traintype> <countpassengers>100</countpassengers> <routname>Brest-Minsk</routname> </traintype> </train> </tns:trains> ... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 04:17 |
|
не получается задать уникальность
|
|||
---|---|---|---|
#18+
Код: plaintext 1. 2. 3.
... |
|||
:
Нравится:
Не нравится:
|
|||
25.11.2010, 08:04 |
|
|
start [/forum/topic.php?fid=14&fpage=31&tid=1333073]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
43ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
33ms |
get tp. blocked users: |
1ms |
others: | 13ms |
total: | 128ms |
0 / 0 |