Subversion Repositories eFlore/Applications.cel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1328 aurelien 1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- http://www.xml.com/lpt/a/2002/01/23/relaxng.html -->
3
<!-- http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html -->
4
<!-- http://www.zvon.org/xxl/XMLSchemaTutorial/Output/ser_wildcards_st8.html -->
5
 
6
<grammar xmlns='http://relaxng.org/ns/structure/1.0'
7
        xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
8
        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
9
        ns='http://purl.org/rss/1.0/'
10
        datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>
11
 
12
    <start>
13
        <element name='RDF' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
14
            <ref name='RDFContent'/>
15
        </element>
16
    </start>
17
 
18
    <define name='RDFContent' ns='http://purl.org/rss/1.0/'>
19
        <interleave>
20
            <element name='channel'>
21
                <ref name='channelContent'/>
22
            </element>
23
            <optional>
24
                <element name='image'><ref name='imageContent'/></element>
25
            </optional>
26
            <oneOrMore>
27
                <element name='item'><ref name='itemContent'/></element>
28
            </oneOrMore>
29
        </interleave>
30
    </define>
31
 
32
     <define name='channelContent' combine="interleave">
33
        <interleave>
34
            <element name='title'><data type='string'/></element>
35
            <element name='link'><data type='anyURI'/></element>
36
            <element name='description'><data type='string'/></element>
37
            <element name='image'>
38
                <attribute name='resource' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
39
                    <data type='anyURI'/>
40
                </attribute>
41
            </element>
42
            <element name='items'>
43
                    <ref name='itemsContent'/>
44
            </element>
45
            <attribute name='about' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
46
                <data type='anyURI'/>
47
            </attribute>
48
        </interleave>
49
    </define>
50
 
51
        <define name="itemsContent">
52
            <element name="Seq" ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
53
                <oneOrMore>
54
                    <element name="li" ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
55
                        <choice>
56
                            <attribute name='resource'>    <!-- Why doesn't RDF/RSS1.0 ns qualify this attribute? -->
57
                                <data type='anyURI'/>
58
                            </attribute>
59
                            <attribute name='resource' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
60
                                <data type='anyURI'/>
61
                            </attribute>
62
                        </choice>
63
                    </element>
64
                </oneOrMore>
65
            </element>
66
        </define>
67
 
68
    <define name='imageContent'>
69
        <interleave>
70
            <element name='title'><data type='string'/></element>
71
            <element name='link'><data type='anyURI'/></element>
72
            <element name='url'><data type='anyURI'/></element>
73
            <attribute name='about' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
74
                <data type='anyURI'/>
75
            </attribute>
76
        </interleave>
77
    </define>
78
 
79
    <define name='itemContent'>
80
        <interleave>
81
            <element name='title'><data type='string'/></element>
82
            <element name='link'><data type='anyURI'/></element>
83
            <optional><element name='description'><data type='string'/></element></optional>
84
            <ref name="anyThing"/>
85
            <attribute name='about' ns='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
86
                <data type='anyURI'/>
87
            </attribute>
88
        </interleave>
89
    </define>
90
 
91
 
92
        <define name='anyThing'>
93
            <zeroOrMore>
94
                <choice>
95
                    <text/>
96
                    <element>
97
                        <anyName>
98
                            <except>
99
                                <nsName/>
100
                            </except>
101
                        </anyName>
102
                        <ref name='anyThing'/>
103
                        <zeroOrMore>
104
                            <attribute>
105
                              <anyName/>
106
                            </attribute>
107
                        </zeroOrMore>
108
                    </element>
109
                </choice>
110
            </zeroOrMore>
111
            </define>
112
 
113
</grammar>