[xml schema] rozgałęzienie

0

aktualnie "zestawienie_wyjazdów" rozgałęzia mi się na: "wyjazd" i "wyjazd2", a ja chcę żeby było "wyjazd" i "wyjazd":

http://img123.imageshack.us/my.php?image=schemagq0.jpg

Co mam zmienić w kodzie:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <xs:element name="karta_samochodu">
           <xs:complexType>
                 <xs:sequence>
                       <xs:element name="miejscowosc_i_data" type="xs:string"/>
                       <xs:element name="dane_samochodu">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="numer_katalogowy" type="xs:integer"/>
                                         <xs:element name="marka" type="xs:string"/>
                                         <xs:element name="model" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="dane_uzytkownika">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="identyfikator" type="xs:integer"/>
                                         <xs:element name="imie" type="xs:string"/>
                                         <xs:element name="nazwisko" type="xs:string"/>
                                         <xs:element name="stanowisko" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="zestawienie_wyjazdow">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="wyjazd">
                                               <xs:complexType>
                                                     <xs:sequence>
                                                           <xs:element name="lp" type="xs:integer"/>
                                                           <xs:element name="przebieg" type="xs:decimal"/>
                                                           <xs:element name="miejsce_wyjazdu" type="xs:string"/>
                                                           <xs:element name="cel_podrozy" type="xs:string"/>
                                                     </xs:sequence>
                                               </xs:complexType>
                                         </xs:element>
                                         <xs:element name="wyjazd2">
                                               <xs:complexType>
                                                     <xs:sequence>
                                                           <xs:element name="lp" type="xs:integer"/>
                                                           <xs:element name="przebieg" type="xs:decimal"/>
                                                           <xs:element name="miejsce_wyjazdu" type="xs:string"/>
                                                           <xs:element name="cel_podrozy" type="xs:string"/>
                                                     </xs:sequence>
                                               </xs:complexType>
                                         </xs:element>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="daty_pobrania_i_zwrotu_auta">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="data_i_godzina_pobrania_auta" type="xs:date"/>
                                         <xs:element name="data_i_godzina_zwrotu_auta" type="xs:date"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="nazwiska_wydajacego_i_zwracajacego">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="samochod_wydal" type="xs:string"/>
                                         <xs:element name="samochod_odebral" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                 </xs:sequence>
           </xs:complexType>
     </xs:element>
</xs:schema>
0
xyzxyz napisał(a)

aktualnie "zestawienie_wyjazdów" rozgałęzia mi się na: "wyjazd" i "wyjazd2", a ja chcę żeby było "wyjazd" i "wyjazd":

http://img123.imageshack.us/my.php?image=schemagq0.jpg

Co mam zmienić w kodzie:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="karta_samochodu">
xs:complexType
xs:sequence
<xs:element name="miejscowosc_i_data" type="xs:string"/>
<xs:element name="dane_samochodu">
xs:complexType
xs:sequence
<xs:element name="numer_katalogowy" type="xs:integer"/>
<xs:element name="marka" type="xs:string"/>
<xs:element name="model" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="dane_uzytkownika">
xs:complexType
xs:sequence
<xs:element name="identyfikator" type="xs:integer"/>
<xs:element name="imie" type="xs:string"/>
<xs:element name="nazwisko" type="xs:string"/>
<xs:element name="stanowisko" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="zestawienie_wyjazdow">
xs:complexType
xs:sequence
<xs:element name="wyjazd">
xs:complexType
xs:sequence
<xs:element name="lp" type="xs:integer"/>
<xs:element name="przebieg" type="xs:decimal"/>
<xs:element name="miejsce_wyjazdu" type="xs:string"/>
<xs:element name="cel_podrozy" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

tutaj masz swój wyjazd2, domyśl się co zmienić
------------------------------------------------------------+
|
V

                                    <xs:element name="wyjazd2">
                                           <xs:complexType>
                                                 <xs:sequence>
                                                       <xs:element name="lp" type="xs:integer"/>
                                                       <xs:element name="przebieg" type="xs:decimal"/>
                                                       <xs:element name="miejsce_wyjazdu" type="xs:string"/>
                                                       <xs:element name="cel_podrozy" type="xs:string"/>
                                                 </xs:sequence>
                                           </xs:complexType>
                                     </xs:element>
                               </xs:sequence>
                         </xs:complexType>
                   </xs:element>
                   <xs:element name="daty_pobrania_i_zwrotu_auta">
                         <xs:complexType>
                               <xs:sequence>
                                     <xs:element name="data_i_godzina_pobrania_auta" type="xs:date"/>
                                     <xs:element name="data_i_godzina_zwrotu_auta" type="xs:date"/>
                               </xs:sequence>
                         </xs:complexType>
                   </xs:element>
                   <xs:element name="nazwiska_wydajacego_i_zwracajacego">
                         <xs:complexType>
                               <xs:sequence>
                                     <xs:element name="samochod_wydal" type="xs:string"/>
                                     <xs:element name="samochod_odebral" type="xs:string"/>
                               </xs:sequence>
                         </xs:complexType>
                   </xs:element>
             </xs:sequence>
       </xs:complexType>
 </xs:element>

</xs:schema>

0

A ja tylko zapytam - w czym robisz XSD graficznie?

0

cr0n0 - to powiedz co mam niby zmienić, bo Ci zapewne chodziło, że "wyjazd2" należy po prostu zmienić na "wyjazd" - niestety, ale wtedy będą 2 razy "wyjazd" i BEDZIE BLAD !!!!!!!! Dlatego się pytam co zrobić ?

Marooned - tę grafikę robi mi edytor Altova XMLSpy

0
xyzxyz napisał(a)

aktualnie "zestawienie_wyjazdów" rozgałęzia mi się na: "wyjazd" i "wyjazd2", a ja chcę żeby było "wyjazd" i "wyjazd":

http://img123.imageshack.us/my.php?image=schemagq0.jpg

Co mam zmienić w kodzie:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <xs:element name="karta_samochodu">
           <xs:complexType>
                 <xs:sequence>
                       <xs:element name="miejscowosc_i_data" type="xs:string"/>
                       <xs:element name="dane_samochodu">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="numer_katalogowy" type="xs:integer"/>
                                         <xs:element name="marka" type="xs:string"/>
                                         <xs:element name="model" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="dane_uzytkownika">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="identyfikator" type="xs:integer"/>
                                         <xs:element name="imie" type="xs:string"/>
                                         <xs:element name="nazwisko" type="xs:string"/>
                                         <xs:element name="stanowisko" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="zestawienie_wyjazdow">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="wyjazd">
                                               <xs:complexType>
                                                     <xs:sequence>
                                                           <xs:element name="lp" type="xs:integer"/>
                                                           <xs:element name="przebieg" type="xs:decimal"/>
                                                           <xs:element name="miejsce_wyjazdu" type="xs:string"/>
                                                           <xs:element name="cel_podrozy" type="xs:string"/>
                                                     </xs:sequence>
                                               </xs:complexType>
                                         </xs:element>

///


                                         <xs:element name="wyjazd2">
                                               <xs:complexType>
                                                     <xs:sequence>
                                                           <xs:element name="lp" type="xs:integer"/>
                                                           <xs:element name="przebieg" type="xs:decimal"/>
                                                           <xs:element name="miejsce_wyjazdu" type="xs:string"/>
                                                           <xs:element name="cel_podrozy" type="xs:string"/>
                                                     </xs:sequence>
                                               </xs:complexType>
                                         </xs:element>

///
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="daty_pobrania_i_zwrotu_auta">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="data_i_godzina_pobrania_auta" type="xs:date"/>
                                         <xs:element name="data_i_godzina_zwrotu_auta" type="xs:date"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                       <xs:element name="nazwiska_wydajacego_i_zwracajacego">
                             <xs:complexType>
                                   <xs:sequence>
                                         <xs:element name="samochod_wydal" type="xs:string"/>
                                         <xs:element name="samochod_odebral" type="xs:string"/>
                                   </xs:sequence>
                             </xs:complexType>
                       </xs:element>
                 </xs:sequence>
           </xs:complexType>
     </xs:element>
</xs:schema>

źle cię zrozumiałem... myślałem że chcesz żeby wyjazd2 w ogóle nie było. wówczas trzeba by usunąć to co jest pomiędzy ///.

a jeżeli czcesz mieć dwie gałęzie identyczne mające tą samą właściwość NAME to nie da rady, chyba że ustalisz właściwość wyświetlanej nazwy na "wyjazd". O ile jest taka właściwość. poszukam,

1 użytkowników online, w tym zalogowanych: 0, gości: 1