Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devonsparks
Last active August 23, 2019 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devonsparks/f18a5b8b23ac452cfe8c8824324041fb to your computer and use it in GitHub Desktop.
Save devonsparks/f18a5b8b23ac452cfe8c8824324041fb to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ifc="http://www.buildingsmart-tech.org/ifc/review/IFC-X/unspecifiedrelease" targetNamespace="http://www.buildingsmart-tech.org/ifc/review/IFC-X/unspecifiedrelease" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="ifcXML" type="ifc:ifcXML" substitutionGroup="ifc:uos"/>
<xs:complexType name="ifcXML">
<xs:complexContent>
<xs:extension base="ifc:uos">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="ifc:Entity"/>
</xs:choice>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
******************************
***** MyContainer *****
******************************
-->
<xs:element name="MyContainer" type="ifc:MyContainer" abstract="false" substitutionGroup="ifc:Entity" nillable="true"/>
<xs:complexType name="MyContainer" abstract="false">
<xs:complexContent>
<xs:extension base="ifc:Entity">
<xs:all>
<xs:element name="Elements">
<xs:complexType>
<xs:sequence>
<xs:group ref="ifc:MyElement-complexEntity-group" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ref" type="xs:IDREF" use="optional"/>
<xs:attribute ref="ifc:itemType" fixed="ifc:MyElement"/>
<xs:attribute ref="ifc:cType" fixed="list"/>
<xs:attribute ref="ifc:arraySize" use="optional"/>
</xs:complexType>
</xs:element>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
From ISO 10303-28:2007, clause 7.5.6
"For every entity data type in the context schema, the XML schema shall contain XML declarations for
two groups that correspond to the entity data type: a subtypes group as specified in 7.5.6.1, and a
complexEntity group as specified in 7.5.6.2."
-->
<xs:group name="MyContainer-group">
<xs:choice>
<!-- subtypes would go here per ISO 10303-28:2007, clause 7.5.6.1 -->
</xs:choice>
</xs:group>
<xs:group name="MyContainer-complexEntity-group">
<xs:choice>
<xs:group ref="ifc:MyContainer-group"/>
</xs:choice>
</xs:group>
<!--
******************************
***** MyElement *****
******************************
-->
<xs:element name="MyElement" type="ifc:MyElement" abstract="false" substitutionGroup="ifc:Entity" nillable="true"/>
<!-- MyElement -->
<xs:complexType name="MyElement" abstract="false">
<xs:complexContent>
<xs:extension base="ifc:Entity">
<xs:all>
<!--
IfcGlobalId is not an EXPRESS Entity, so it is handled by ISO 10303-28:2007, clause 7.6.3.1
"If the data type of the EXPRESS attribute is not an entity data type, the data type of the accessor
element shall be declared to be the XML schema data type that corresponds to the data type of the
EXPRESS attribute."
-->
<xs:element name="GlobalId" type="ifc:IfcGloballyUniqueId" />
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:group name="MyElement-group">
<xs:choice>
<xs:element ref="ifc:MyElement"/>
<!-- subtypes would go here per ISO 10303-28:2007, clause 7.5.6.1 -->
</xs:choice>
</xs:group>
<xs:group name="MyElement-complexEntity-group">
<xs:choice>
<xs:group ref="ifc:MyElement-group"/>
</xs:choice>
</xs:group>
<!--
******************************
Boilerplate - used to hold the sample
******************************
-->
<!--
base entity and entity attribute declaration (for embeded base schema definitions)
Derived directly from ISO 10303-28:2007, Section 7.5.3.1
-->
<xs:element name="Entity" type="ifc:Entity" abstract="true" nillable="true"/>
<xs:complexType name="Entity" abstract="true">
<xs:attribute name="href" type="xs:anyURI" use="optional"/>
<xs:attribute name="ref" type="xs:IDREF" use="optional"/>
<xs:attributeGroup ref="ifc:instanceAttributes"/>
</xs:complexType>
<!--
base global attribute declaration (for embeded base schema definitions)
-->
<xs:attributeGroup name="instanceAttributes">
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="path" type="xs:NMTOKENS" use="optional"/>
<xs:attribute name="pos" use="optional">
<xs:simpleType>
<xs:restriction>
<xs:simpleType>
<xs:list itemType="xs:integer"/>
</xs:simpleType>
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:attribute name="arraySize">
<xs:simpleType>
<xs:restriction>
<xs:simpleType>
<xs:list itemType="xs:integer"/>
</xs:simpleType>
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="itemType">
<xs:simpleType>
<xs:list itemType="xs:QName"/>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cType">
<xs:simpleType>
<xs:list itemType="ifc:aggregateType"/>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="aggregateType">
<xs:restriction base="xs:normalizedString">
<xs:enumeration value="array"/>
<xs:enumeration value="list"/>
<xs:enumeration value="set"/>
<xs:enumeration value="bag"/>
<xs:enumeration value="array-unique"/>
<xs:enumeration value="array-optional"/>
<xs:enumeration value="array-optional-unique"/>
<xs:enumeration value="list-unique"/>
</xs:restriction>
</xs:simpleType>
<!-- IfcGloballyUniqueId -->
<xs:simpleType name="IfcGloballyUniqueId">
<xs:restriction base="xs:normalizedString">
<xs:minLength value="22"/>
<xs:maxLength value="22"/>
</xs:restriction>
</xs:simpleType>
<!-- Seq-anyURI -->
<xs:simpleType name="Seq-anyURI">
<xs:list itemType="xs:anyURI"/>
</xs:simpleType>
<xs:element name="uos" type="ifc:uos" abstract="true"/>
<xs:complexType name="uos" abstract="true">
<xs:sequence>
<xs:element name="header" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0"/>
<xs:element name="time_stamp" type="xs:dateTime" minOccurs="0"/>
<xs:element name="author" type="xs:string" minOccurs="0"/>
<xs:element name="organization" type="xs:string" minOccurs="0"/>
<xs:element name="preprocessor_version" type="xs:string" minOccurs="0"/>
<xs:element name="originating_system" type="xs:string" minOccurs="0"/>
<xs:element name="authorization" type="xs:string" minOccurs="0"/>
<xs:element name="documentation" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="optional"/>
<xs:attribute name="express" type="ifc:Seq-anyURI" use="optional"/>
<xs:attribute name="configuration" type="ifc:Seq-anyURI" use="optional"/>
</xs:complexType>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment