summaryrefslogtreecommitdiffstats
path: root/schemas
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-04-13 11:40:50 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-04-13 11:40:50 -0400
commite386c37ff7436f78c1a9dd33e0c90e2b3254c99d (patch)
treea7df466017cd180d7fbf093234b9bd45d4e83abf /schemas
parent545dda76d34a06ae25efa2eb3d0c8c0bd70127d0 (diff)
downloadbcfg2-e386c37ff7436f78c1a9dd33e0c90e2b3254c99d.tar.gz
bcfg2-e386c37ff7436f78c1a9dd33e0c90e2b3254c99d.tar.bz2
bcfg2-e386c37ff7436f78c1a9dd33e0c90e2b3254c99d.zip
* Made Metadata files validate whether or not XIncludes had been processed
* bcfg2-repo-validate does not chase XIncludes if --stdin has been specified, but just validates the Metadata files you provide on stdin
Diffstat (limited to 'schemas')
-rw-r--r--schemas/metadata.xsd6
-rw-r--r--schemas/xinclude.xsd41
2 files changed, 46 insertions, 1 deletions
diff --git a/schemas/metadata.xsd b/schemas/metadata.xsd
index 7d07c4971..58f9e8029 100644
--- a/schemas/metadata.xsd
+++ b/schemas/metadata.xsd
@@ -1,4 +1,5 @@
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en">
<xsd:annotation>
<xsd:documentation>
@@ -10,6 +11,8 @@
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>
+ <xsd:import namespace="http://www.w3.org/2001/XInclude"
+ schemaLocation="xinclude.xsd"/>
<xsd:complexType name='groupType'>
<xsd:choice minOccurs='0' maxOccurs='unbounded'>
@@ -37,6 +40,7 @@
<xsd:choice minOccurs='0' maxOccurs='unbounded'>
<xsd:element name='Group' type='groupType'/>
<xsd:element name='Groups' type='groupsType'/>
+ <xsd:element ref="xi:include"/>
</xsd:choice>
<xsd:attribute name='version' type='xsd:string'/>
<xsd:attribute name='origin' type='xsd:string'/>
diff --git a/schemas/xinclude.xsd b/schemas/xinclude.xsd
new file mode 100644
index 000000000..de58df4e0
--- /dev/null
+++ b/schemas/xinclude.xsd
@@ -0,0 +1,41 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ targetNamespace="http://www.w3.org/2001/XInclude"
+ finalDefault="extension">
+ <xs:annotation>
+ <xs:documentation>
+ The official XInclude XML Schema document is not normative or
+ deterministic. This schema implements only the features of
+ XInclude that are used in Bcfg2 in a manner that is deterministic
+ (i.e., passes XML validation).
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name="include" type="xi:includeType" />
+ <xs:complexType name="includeType" mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded" >
+ <xs:element ref="xi:fallback" />
+ </xs:choice>
+ <xs:attribute name="href" use="optional" type="xs:anyURI"/>
+ <xs:attribute name="parse" use="optional" default="xml"
+ type="xi:parseType" />
+ <xs:attribute name="xpointer" use="optional" type="xs:string"/>
+ <xs:attribute name="encoding" use="optional" type="xs:string"/>
+ <xs:attribute name="accept" use="optional" type="xs:string"/>
+ <xs:attribute name="accept-language" use="optional" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:simpleType name="parseType">
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="xml"/>
+ <xs:enumeration value="text"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:element name="fallback" type="xi:fallbackType" />
+ <xs:complexType name="fallbackType" mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xi:include"/>
+ </xs:choice>
+ </xs:complexType>
+</xs:schema>