Skip to content

Commit

Permalink
Added support for namespace bindings in modules and external constrai…
Browse files Browse the repository at this point in the history
…nts.
  • Loading branch information
david-waltermire committed Jul 22, 2024
1 parent 38bd81e commit d089dde
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
11 changes: 8 additions & 3 deletions schema/metaschema/metaschema-module-metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</define-flag>
</define-assembly>
<assembly ref="metapath-namespace" max-occurs="unbounded">
<group-as name="namespaces" />
<group-as name="namespace-bindings" />
</assembly>
<choice-group max-occurs="unbounded">
<group-as name="definitions" in-json="ARRAY"/>
Expand Down Expand Up @@ -189,7 +189,7 @@
<define-assembly name="metapath-namespace">
<formal-name>Metapath Namespace Declaration</formal-name>
<description>Assigns a Metapath namespace to a prefix for use in a Metapath expression in a lexical qualified name.</description>
<use-name>namespace</use-name>
<use-name>namespace-binding</use-name>
<define-flag name="uri" as-type="uri" required="yes">
<formal-name>Metapath Namespace URI</formal-name>
<description>The namespace URI to bind to the prefix.</description>
Expand Down Expand Up @@ -1256,6 +1256,11 @@
<description>A relative or absolute URI for retrieving an out-of-line Metaschema constraint definition.</description>
</define-flag>
</define-assembly>

<assembly ref="metapath-namespace" max-occurs="unbounded">
<group-as name="namespace-bindings" />
</assembly>

<define-assembly name="scope" min-occurs="1" max-occurs="unbounded">
<group-as name="scopes" in-json="ARRAY"/>
<define-flag name="metaschema-namespace" as-type="uri" required="yes"/>
Expand Down Expand Up @@ -1321,7 +1326,7 @@
<root-name>metaschema-meta-constraints</root-name>
<model>
<assembly ref="metapath-namespace" max-occurs="unbounded">
<group-as name="namespaces" />
<group-as name="namespace-bindings" />
</assembly>

<define-assembly name="definition-context">
Expand Down
1 change: 1 addition & 0 deletions schema/xml/metaschema-meta-constraints.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<xs:element name="metaschema-meta-constraints">
<xs:complexType>
<xs:sequence>
<xs:element name="namespace-binding" type="NamespaceBindingType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="context" type="ModelContextType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Expand Down
19 changes: 19 additions & 0 deletions schema/xml/metaschema.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

<xs:element name="import" type="MetaschemaImportType" minOccurs="0" maxOccurs="unbounded"/>

<xs:element name="namespace-binding" type="NamespaceBindingType" minOccurs="0" maxOccurs="unbounded"/>

<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="define-assembly" type="GlobalAssemblyDefinitionType"/>
<xs:element name="define-field" type="GlobalFieldDefinitionType"/>
Expand Down Expand Up @@ -80,6 +82,22 @@
</xs:attribute>
</xs:complexType>

<xs:complexType name="NamespaceBindingType">
<xs:annotation>
<xs:documentation>Assigns a Metapath namespace to a prefix for use in a Metapath expression in a lexical qualified name.</xs:documentation>
</xs:annotation>
<xs:attribute name="prefix" type="TokenDatatype" use="required">
<xs:annotation>
<xs:documentation>The prefix that is bound to the namespace.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="uri" type="URIDatatype" use="required">
<xs:annotation>
<xs:documentation>The namespace URI to bind to the prefix.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:group name="DefinitionMetadataGroup">
<xs:sequence>
<xs:element name="formal-name" minOccurs="0">
Expand Down Expand Up @@ -1303,6 +1321,7 @@
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="namespace-binding" type="NamespaceBindingType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="scope" maxOccurs="unbounded">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
Expand Down

0 comments on commit d089dde

Please sign in to comment.