summaryrefslogtreecommitdiffstats
path: root/schemas/patch-ops.xml
blob: 8360e01fee15c28e04993dde1ad03f6dfb3e76d1 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema [
 <!ENTITY ncname "\i\c*">
 <!ENTITY qname  "(&ncname;:)?&ncname;">
 <!ENTITY aname  "@&qname;">
 <!ENTITY pos    "\[\d+\]">
 <!ENTITY attr   "\[&aname;='(.)*'\]|\[&aname;=&quot;(.)*&quot;\]">
 <!ENTITY valueq "\[(&qname;|\.)=&quot;(.)*&quot;\]">
 <!ENTITY value  "\[(&qname;|\.)='(.)*'\]|&valueq;">
 <!ENTITY cond   "&attr;|&value;|&pos;">
 <!ENTITY step   "(&qname;|\*)(&cond;)*">
 <!ENTITY piq    "processing-instruction\((&quot;&ncname;&quot;)\)">
 <!ENTITY pi     "processing-instruction\(('&ncname;')?\)|&piq;">
 <!ENTITY id     "id\(('&ncname;')?\)|id\((&quot;&ncname;&quot;)?\)">
 <!ENTITY com    "comment\(\)">
 <!ENTITY text   "text\(\)">
 <!ENTITY nspa   "namespace::&ncname;">
 <!ENTITY cnodes "(&text;(&pos;)?)|(&com;(&pos;)?)|((&pi;)(&pos;)?)">
 <!ENTITY child  "&cnodes;|&step;">
 <!ENTITY last   "(&child;|&aname;|&nspa;)">
]>
<xsd:schema
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified">

 <xsd:simpleType name="xpath">
  <xsd:restriction base="xsd:string">
   <xsd:pattern
    value="(/)?((&id;)((/&step;)*(/&last;))?|(&step;/)*(&last;))"/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="xpath-add">
  <xsd:restriction base="xsd:string">
   <xsd:pattern
    value="(/)?((&id;)((/&step;)*(/&child;))?|(&step;/)*(&child;))"/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="pos">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="before"/>
   <xsd:enumeration value="after"/>
   <xsd:enumeration value="prepend"/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:simpleType name="type">
   <xsd:restriction base="xsd:string">
   <xsd:pattern value="&aname;|&nspa;"/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:complexType name="add">
  <xsd:complexContent mixed="true">
   <xsd:restriction base="xsd:anyType">
    <xsd:sequence>
     <xsd:any processContents="lax" namespace="##any"
              minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="sel" type="xpath-add"
                   use="required"/>
    <xsd:attribute name="pos" type="pos"/>
    <xsd:attribute name="type" type="type"/>
   </xsd:restriction>
  </xsd:complexContent>
 </xsd:complexType>

 <xsd:complexType name="replace">
  <xsd:complexContent mixed="true">
   <xsd:restriction base="xsd:anyType">
    <xsd:sequence>
     <xsd:any processContents="lax" namespace="##any"
              minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attribute name="sel" type="xpath" use="required"/>
   </xsd:restriction>
  </xsd:complexContent>
 </xsd:complexType>

 <xsd:simpleType name="ws">
  <xsd:restriction base="xsd:string">
   <xsd:enumeration value="before"/>
   <xsd:enumeration value="after"/>
   <xsd:enumeration value="both"/>
  </xsd:restriction>
 </xsd:simpleType>

 <xsd:complexType name="remove">
  <xsd:attribute name="sel" type="xpath" use="required"/>
  <xsd:attribute name="ws" type="ws"/>
 </xsd:complexType>

</xsd:schema>
OpenPOWER on IntegriCloud