File: library.xsd

package info (click to toggle)
eclipse-emf 2.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 57,992 kB
  • ctags: 81,092
  • sloc: java: 561,060; xml: 7,553; sh: 111; makefile: 11
file content (38 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (11)
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
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.example.eclipse.org/Library"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
    xmlns:lib="http://www.example.eclipse.org/Library"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:complexType name="Book">
    <xsd:sequence>
      <xsd:element name="title" type="xsd:string"/>
      <xsd:element name="pages" type="xsd:int"/>
      <xsd:element name="category" type="lib:BookCategory"/>
      <xsd:element name="author" type="xsd:anyURI"
          ecore:reference="lib:Writer" ecore:opposite="books"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="Writer">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element maxOccurs="unbounded" minOccurs="0" name="books"
          type="xsd:anyURI" ecore:reference="lib:Book" ecore:opposite="author"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="Library">
    <xsd:sequence>
      <xsd:element name="name" type="xsd:string"/>
      <xsd:element maxOccurs="unbounded" minOccurs="0"
          name="writers" type="lib:Writer"/>
      <xsd:element maxOccurs="unbounded" minOccurs="0"
          name="books" type="lib:Book"/>
    </xsd:sequence>
  </xsd:complexType>
  <xsd:simpleType name="BookCategory">
    <xsd:restriction base="xsd:NCName">
      <xsd:enumeration value="Mystery"/>
      <xsd:enumeration value="ScienceFiction"/>
      <xsd:enumeration value="Biography"/>
    </xsd:restriction>
  </xsd:simpleType>
</xsd:schema>