Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- Przykład schematu z zagnieżdżonymi wyborami i sekwencjami. Elementy i typy zupełnie sztuczne.
- </xs:documentation>
- </xs:annotation>
- <!-- Definicje elementów. -->
- <xs:element name="Start" type="xs:string"/>
- <xs:element name="A" type="xs:string"/>
- <xs:element name="B" type="xs:string"/>
- <xs:element name="C" type="xs:string"/>
- <xs:element name="Koniec" type="xs:string"/>
- <!-- Definicjwe typów. -->
- <xs:complexType name="typ1">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- Dokładnie jeden element B lub od 2 do 3 elementów A oraz opcjonalnie jedem C.
- </xs:documentation>
- </xs:annotation>
- <xs:choice>
- <xs:element ref="A" minOccurs="2" maxOccurs="3"/>
- <xs:element ref="B" use="required"/>
- <xs:element ref="C" use="optional"/>
- </xs:choice>
- </xs:complexType>
- <xs:complexType name="typ2">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element ref="Start"/>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="A" use="required"/>
- <xs:sequence>
- <xs:element ref="B" minOccurs="2" maxOccurs="2"/>
- <xs:element ref="C" minOccurs="3" maxOccurs="3"/>
- </xs:sequence>
- </xs:choice>
- <xs:element ref="Koniec"/>
- </xs:sequence>
- </xs:complexType>
- <!-- Tu dopisz nowe definicje typów -->
- <xs:complexType name="typ3">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- Wybór między parzystą liczba elementów lub podzielną przez 3 A.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence use="required">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="A" minOccurs="2" maxOccurs="2"/>
- </xs:choice>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="A" minOccurs="3" maxOccurs="3"/>
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="typ4">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- Elementy A,B I C w dowolnej kolejności.
- </xs:documentation>
- </xs:annotation>
- <xs:all minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="A" use="required"/>
- <xs:element ref="B" use="required"/>
- <xs:element ref="C" use="optional"/>
- </xs:all>
- </xs:complexType>
- <xs:complexType name="typ5">
- <xs:annotation>
- <xs:documentation xml:lang="pl">
- Od2-3 element A, jeden element B i opcjonalny C.
- </xs:documentation>
- </xs:annotation>
- <xs:all minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="A" minOccurs="2" maxOccurs="3"/>
- <xs:element ref="B" use="required"/>
- <xs:element ref="C" use="optional"/>
- </xs:all>
- </xs:complexType>
- <xs:element name="root" type="typ1"/>
- </xs:schema>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement