Skip to content

Commit

Permalink
Added support for declaration of let expressions in constraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Nov 10, 2023
1 parent cf635d8 commit 6599190
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions schema/xml/metaschema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,27 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="ConstraintLetType">
<xs:sequence>
<xs:group ref="ConstraintContentsGroup"/>
</xs:sequence>
<xs:attribute name="var" type="TokenDatatype" use="required"/>
<xs:attribute name="expression" type="MetaschemaPathType" use="required"/>
</xs:complexType>

<xs:group name="LetExpressionGroup">
<xs:sequence>
<xs:element name="let" type="ConstraintLetType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Declares a variable whose name is bound to the result of the Metapath expression. These variables can be used in target and other Metapath expressions used in constrains that are declared in the same context or in constraints declared in a child assembly, field, or flag.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:group>

<xs:complexType name="DefineFlagConstraintsType">
<xs:sequence>
<xs:group ref="LetExpressionGroup"/>
<xs:choice maxOccurs="unbounded">
<xs:element minOccurs="0" name="allowed-values" type="AllowedValuesType">
<xs:annotation>
Expand Down Expand Up @@ -1119,6 +1138,7 @@

<xs:complexType name="DefineFieldConstraintsType">
<xs:sequence>
<xs:group ref="LetExpressionGroup"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:group ref="TargetedCommonConstraintsGroup"/>
</xs:choice>
Expand All @@ -1128,6 +1148,7 @@

<xs:complexType name="DefineAssemblyConstraintsType">
<xs:sequence>
<xs:group ref="LetExpressionGroup"/>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:group ref="TargetedCommonConstraintsGroup"/>
<xs:group ref="AssemblyConstraintsGroup"/>
Expand Down

0 comments on commit 6599190

Please sign in to comment.