-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schemas: Added xsd schemas for RequirementData and RequirementNodeData
- Loading branch information
1 parent
dc8fc1e
commit 692e3ed
Showing
3 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:element name="Catalog" type="RequirementDataCatalog"/> | ||
|
||
<xs:complexType name="RequirementDataCatalog"> | ||
<xs:sequence maxOccurs="unbounded"> | ||
<xs:element name="CRequirement" type="Requirement"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
|
||
<!-- Seems RedHat's vscode extension doesn't support xsd 1.1, so we have to do some jank for --> | ||
<!-- mixed "only once" and "unbounded" elements in an unsequenced list. --> | ||
<!-- Based off this SO answer: https://stackoverflow.com/a/12012599 --> | ||
<xs:group name="unboundedElements"> | ||
<xs:choice> | ||
<xs:element ref="NodeArray"/> | ||
<xs:element ref="CanBeSuppressed"/> | ||
</xs:choice> | ||
</xs:group> | ||
<xs:complexType name="Requirement"> | ||
<xs:sequence> | ||
<xs:group ref="unboundedElements" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element ref="EditorCategories" minOccurs="0" maxOccurs="1"/> | ||
<xs:group ref="unboundedElements" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:sequence> | ||
<xs:attribute name="id" use="required" type="xs:ID"/> | ||
<xs:attribute name="default" use="optional" type="ZeroOrOne"/> | ||
<xs:attribute name="parent" use="optional" type="xs:IDREF"/> | ||
</xs:complexType> | ||
|
||
<xs:element name="EditorCategories" type="EditorCategories"/> | ||
<xs:element name="NodeArray" type="RequirementNodeLink"/> | ||
<xs:element name="CanBeSuppressed" type="CanBeSuppressed"/> | ||
|
||
<xs:complexType name="RequirementNodeLink"> | ||
<xs:attribute name="index" type="UseOrShow"/> | ||
<xs:attribute name="Link" type="xs:string"/> | ||
</xs:complexType> | ||
<xs:complexType name="EditorCategories"> | ||
<xs:attribute name="value" type="xs:string"/> | ||
</xs:complexType> | ||
<xs:complexType name="CanBeSuppressed"> | ||
<xs:attribute name="index" type="xs:string"/> | ||
<xs:attribute name="value" type="ZeroOrOne"/> | ||
</xs:complexType> | ||
|
||
<xs:simpleType name="ZeroOrOne"> | ||
<xs:restriction base="xs:int"> | ||
<xs:enumeration value="0"/> | ||
<xs:enumeration value="1"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
<xs:simpleType name="UseOrShow"> | ||
<xs:restriction base="xs:string"> | ||
<xs:enumeration value="Use"/> | ||
<xs:enumeration value="Show"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
|
||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:element name="Catalog"> | ||
<xs:complexType> | ||
<xs:sequence maxOccurs="unbounded"> | ||
<xs:group ref="top_level_elements"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
<xs:unique name="ids_within_a_document_must_be_unique"> | ||
<xs:selector xpath=" | ||
CRequirementAllowAbil | ||
|CRequirementAllowUnit | ||
|CRequirementAllowUpgrade | ||
|CRequirementCountBehavior | ||
|CRequirementCountUnit | ||
|CRequirementCountUpgrade | ||
|CRequirementNot | ||
|CRequirementAnd | ||
|CRequirementOr | ||
|CRequirementEq | ||
|CRequirementLT | ||
|CRequirementGT | ||
"/> | ||
<xs:field xpath="@id"/> | ||
</xs:unique> | ||
</xs:element> | ||
<xs:group name="top_level_elements"> | ||
<xs:choice> | ||
<xs:element name="CRequirementAllowAbil" type="RequirementTypeAllow"/> | ||
<xs:element name="CRequirementAllowUnit" type="RequirementTypeAllow"/> | ||
<xs:element name="CRequirementAllowUpgrade" type="RequirementTypeAllow"/> | ||
<xs:element name="CRequirementCountBehavior" type="RequirementTypeCount"/> | ||
<xs:element name="CRequirementCountUnit" type="RequirementTypeCount"/> | ||
<xs:element name="CRequirementCountUpgrade" type="RequirementTypeCount"/> | ||
<xs:element name="CRequirementNot" type="RequirementTypeUnaryOp"/> | ||
<xs:element name="CRequirementAnd" type="RequirementTypeOp"/> | ||
<xs:element name="CRequirementOr" type="RequirementTypeOp"/> | ||
<xs:element name="CRequirementEq" type="RequirementTypeOp"/> | ||
<xs:element name="CRequirementLT" type="RequirementTypeOp"/> | ||
<xs:element name="CRequirementGT" type="RequirementTypeOp"/> | ||
</xs:choice> | ||
</xs:group> | ||
|
||
<xs:complexType name="RequirementType"> | ||
<xs:attribute name="id" type="xs:string"/> | ||
<xs:attribute name="default" type="ZeroOrOne" use="optional"/> | ||
<xs:attribute name="parent" type="xs:string" use="optional"/> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="RequirementTypeAllow"> | ||
<xs:complexContent> | ||
<xs:extension base="RequirementType"> | ||
<xs:all> | ||
<xs:element ref="Link"/> | ||
<xs:element ref="Flags" minOccurs="0"/> | ||
<xs:element ref="Tooltip" minOccurs="0"/> | ||
</xs:all> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="RequirementTypeCount"> | ||
<xs:complexContent> | ||
<xs:extension base="RequirementType"> | ||
<xs:all> | ||
<xs:element ref="Count"/> | ||
<xs:element ref="Flags" minOccurs="0"/> | ||
<xs:element ref="Tooltip" minOccurs="0"/> | ||
</xs:all> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="RequirementTypeUnaryOp"> | ||
<xs:complexContent> | ||
<xs:extension base="RequirementType"> | ||
<xs:all> | ||
<xs:element ref="OperandArray" minOccurs="0"/> | ||
<xs:element ref="Flags" minOccurs="0"/> | ||
<xs:element ref="Tooltip" minOccurs="0"/> | ||
</xs:all> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
|
||
<xs:complexType name="RequirementTypeOp"> | ||
<xs:complexContent> | ||
<xs:extension base="RequirementType"> | ||
<xs:choice> | ||
<xs:sequence> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element ref="Flags" minOccurs="0"/> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element ref="Tooltip" minOccurs="0"/> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:sequence> | ||
<xs:sequence> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element ref="Tooltip" minOccurs="0"/> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
<xs:element ref="Flags" minOccurs="0"/> | ||
<xs:element ref="OperandArray" minOccurs="0" maxOccurs="unbounded"/> | ||
</xs:sequence> | ||
</xs:choice> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
|
||
<xs:element name="OperandArray"> | ||
<xs:complexType> | ||
<xs:attribute name="index" type="ZeroOrOne"/> | ||
<xs:attribute name="value" type="xs:string"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="Flags"> | ||
<xs:complexType> | ||
<xs:attribute name="index" type="xs:string"/> | ||
<xs:attribute name="value" type="ZeroOrOne"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="Tooltip"> | ||
<xs:complexType> | ||
<xs:attribute name="value" type="xs:string"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="Count"> | ||
<xs:complexType> | ||
<xs:attribute name="Link" type="xs:string"/> | ||
<xs:attribute name="State" type="xs:string"/> | ||
<xs:attribute name="Unlock" type="xs:string" use="optional"/> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="Link"> | ||
<xs:complexType> | ||
<xs:attribute name="value" type="xs:string"/> | ||
</xs:complexType> | ||
</xs:element> | ||
|
||
<xs:simpleType name="ZeroOrOne"> | ||
<xs:restriction base="xs:int"> | ||
<xs:enumeration value="0"/> | ||
<xs:enumeration value="1"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
<xs:simpleType name="UseOrShow"> | ||
<xs:restriction base="xs:string"> | ||
<xs:enumeration value="Use"/> | ||
<xs:enumeration value="Show"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
// Use this in your .vscode settings to set the .xsd associations with the Red Hat XML extension | ||
"xml.fileAssociations": [ | ||
{"pattern": "RequirementData.xml", "systemId": "./schemas/SchemaRequirementData.xsd"}, | ||
{"pattern": "RequirementNodeData.xml", "systemId": "./schemas/SchemaRequirementNodeData.xsd"}, | ||
] | ||
} |