patch-ops.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE schema [
  3. <!ENTITY ncname "\i\c*">
  4. <!ENTITY qname "(&ncname;:)?&ncname;">
  5. <!ENTITY aname "@&qname;">
  6. <!ENTITY pos "\[\d+\]">
  7. <!ENTITY attr "\[&aname;='(.)*'\]|\[&aname;=&quot;(.)*&quot;\]">
  8. <!ENTITY valueq "\[(&qname;|\.)=&quot;(.)*&quot;\]">
  9. <!ENTITY value "\[(&qname;|\.)='(.)*'\]|&valueq;">
  10. <!ENTITY cond "&attr;|&value;|&pos;">
  11. <!ENTITY step "(&qname;|\*)(&cond;)*">
  12. <!ENTITY piq "processing-instruction\((&quot;&ncname;&quot;)\)">
  13. <!ENTITY pi "processing-instruction\(('&ncname;')?\)|&piq;">
  14. <!ENTITY id "id\(('&ncname;')?\)|id\((&quot;&ncname;&quot;)?\)">
  15. <!ENTITY com "comment\(\)">
  16. <!ENTITY text "text\(\)">
  17. <!ENTITY nspa "namespace::&ncname;">
  18. <!ENTITY cnodes "(&text;(&pos;)?)|(&com;(&pos;)?)|((&pi;)(&pos;)?)">
  19. <!ENTITY child "&cnodes;|&step;">
  20. <!ENTITY last "(&child;|&aname;|&nspa;)">
  21. ]>
  22. <xsd:schema
  23. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  24. elementFormDefault="qualified">
  25. <xsd:simpleType name="xpath">
  26. <xsd:restriction base="xsd:string">
  27. <xsd:pattern
  28. value="(/)?((&id;)((/&step;)*(/&last;))?|(&step;/)*(&last;))"/>
  29. </xsd:restriction>
  30. </xsd:simpleType>
  31. <xsd:simpleType name="xpath-add">
  32. <xsd:restriction base="xsd:string">
  33. <xsd:pattern
  34. value="(/)?((&id;)((/&step;)*(/&child;))?|(&step;/)*(&child;))"/>
  35. </xsd:restriction>
  36. </xsd:simpleType>
  37. <xsd:simpleType name="pos">
  38. <xsd:restriction base="xsd:string">
  39. <xsd:enumeration value="before"/>
  40. <xsd:enumeration value="after"/>
  41. <xsd:enumeration value="prepend"/>
  42. </xsd:restriction>
  43. </xsd:simpleType>
  44. <xsd:simpleType name="type">
  45. <xsd:restriction base="xsd:string">
  46. <xsd:pattern value="&aname;|&nspa;"/>
  47. </xsd:restriction>
  48. </xsd:simpleType>
  49. <xsd:complexType name="add">
  50. <xsd:complexContent mixed="true">
  51. <xsd:restriction base="xsd:anyType">
  52. <xsd:sequence>
  53. <xsd:any processContents="lax" namespace="##any"
  54. minOccurs="0" maxOccurs="unbounded"/>
  55. </xsd:sequence>
  56. <xsd:attribute name="sel" type="xpath-add"
  57. use="required"/>
  58. <xsd:attribute name="pos" type="pos"/>
  59. <xsd:attribute name="type" type="type"/>
  60. </xsd:restriction>
  61. </xsd:complexContent>
  62. </xsd:complexType>
  63. <xsd:complexType name="replace">
  64. <xsd:complexContent mixed="true">
  65. <xsd:restriction base="xsd:anyType">
  66. <xsd:sequence>
  67. <xsd:any processContents="lax" namespace="##any"
  68. minOccurs="0" maxOccurs="1"/>
  69. </xsd:sequence>
  70. <xsd:attribute name="sel" type="xpath" use="required"/>
  71. </xsd:restriction>
  72. </xsd:complexContent>
  73. </xsd:complexType>
  74. <xsd:simpleType name="ws">
  75. <xsd:restriction base="xsd:string">
  76. <xsd:enumeration value="before"/>
  77. <xsd:enumeration value="after"/>
  78. <xsd:enumeration value="both"/>
  79. </xsd:restriction>
  80. </xsd:simpleType>
  81. <xsd:complexType name="remove">
  82. <xsd:attribute name="sel" type="xpath" use="required"/>
  83. <xsd:attribute name="ws" type="ws"/>
  84. </xsd:complexType>
  85. </xsd:schema>