Personal tools
You are here: Home / Specifications / ifcXML Overview / ifcXML2x2 Release / NameSpace discussion

NameSpace discussion

The following example is used to provide guidance on using the correct name spaces and name space prefixes in an ifcXML document file. Those examples validate in an XML parser, such as xmlspy.

In ifcXML the schema has the following global setting

  • elementFormDefault="qualified"
  • attributeFormDefault="unqualified"

XML elements therefore have always to be either in the default name space, xmlns, or prefixed by the name space alias:

  • ifc for http://www.iai-tech.org/ifcXML/IFC2x2/FINAL
  • ex for urn:iso.org:standard:10303:part(28):version(2):xmlschema:common


Case 1: use of name space declarations to avoid most name space prefixes.

xml_file_iconsample ifcXML file for the case 1 example

<!-- iso_10303_28 root element as defined in ex.xsd, it is the root element for all ifcXML compliant xml documents -->
<iso_10303_28
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common"
xsi:schemaLocation="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common http://www.iai-tech.org/ifcXML/IFC2x2/FINAL/ex.xsd"
version="2.0">
<!-- header information, usually provided in STEP physical file header section, part of ex.xsd context schema independent definitions -->
<iso_10303_28_header>
<name>ifcXML2x2 test file</name>
<time_stamp>2007-05-01T17:07:21</time_stamp>
<author>Thomas Liebich</author>
<organization>AEC3</organization>
<preprocessor_version>Express Data Manager Version 4.7.051 May 4 2006</preprocessor_version>
<originating_system>A CAD System</originating_system>
<authorization></authorization>
<documentation></documentation>
</iso_10303_28_header>
<!-- Unit of Serialization - i.e. context schema specific part -->
<!-- here IFC2x2_FINAL definitions, the uos element is defined in the IFC2X2_FINAL.xsd and the ifc name space -->
<uos id="uos_1" description="" configuration="i-ifc2x2"
xmlns="http://www.iai-tech.org/ifcXML/IFC2x2/FINAL"
xmlns:ex="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common"
xsi:schemaLocation="http://www.iai-tech.org/ifcXML/IFC2x2/FINAL http://www.iai-tech.org/ifcXML/IFC2x2/FINAL/IFC2X2_FINAL.xsd">
<!-- begin of IFC specific XML data content -->
<IfcProject id="i3486">
<GlobalId>2yVaiEFpz8IPpFX8KULtSj</GlobalId>
<OwnerHistory>
<IfcOwnerHistory xsi:nil="true" ref="i1533"/>
</OwnerHistory>
<Name>D:\Data\Projects\ifcXML\Simple Tests\beam_example_1.ifc</Name>
<RepresentationContexts ex:cType="set">
<IfcGeometricRepresentationContext pos="0" xsi:nil="true" ref="i1524"/>
</RepresentationContexts>
<UnitsInContext>
<IfcUnitAssignment xsi:nil="true" ref="i1518"/>
</UnitsInContext>
</IfcProject>

Case 2: use of name space declarations at iso_10303_28 element and use of ex: prefix

xml_file_iconsample ifcXML file for case 2 example

<!-- iso_10303_28 root element as defined in ex.xsd, it is the root element for all ifcXML compliant xml documents -->
<ex:iso_10303_28
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ex="urn:iso.org:standard:10303:part(28):version(2):xmlschema:common"
xmlns="http://www.iai-tech.org/ifcXML/IFC2x2/FINAL"
xsi:schemaLocation="http://www.iai-tech.org/ifcXML/IFC2x2/FINAL http://www.iai-tech.org/ifcXML/IFC2x2/FINAL/IFC2X2_FINAL.xsd"
version="2.0" >
<!-- header information, usually provided in STEP physical file header section, part of ex.xsd context schema independent definitions -->
<ex:iso_10303_28_header>
<ex:name>ifcXML2x2 test file</ex:name>
<ex:time_stamp>2007-05-01T17:07:21</ex:time_stamp>
<ex:author>Thomas Liebich</ex:author>
<ex:organization>AEC3</ex:organization>
<ex:preprocessor_version>Express Data Manager Version 4.7.051 May 4 2006</ex:preprocessor_version>
<ex:originating_system>A CAD System</ex:originating_system>
<ex:authorization></ex:authorization>
<ex:documentation></ex:documentation>
</ex:iso_10303_28_header>
<!-- Unit of Serialization - i.e. context schema specific part - here IFC2x2_FINAL definitions -->
<!-- the uos element is defined in the IFC2X2_FINAL.xsd and the ifc name space -->
<uos id="uos_1" description="" configuration="i-ifc2x2" edo="">
<!-- begin of IFC specific XML data content -->
<IfcProject id="i3486">
<GlobalId>2yVaiEFpz8IPpFX8KULtSj</GlobalId>
<OwnerHistory>
<IfcOwnerHistory xsi:nil="true" ref="i1533"/>
</OwnerHistory>
<Name>D:\Data\Projects\ifcXML\Simple Tests\beam_example_1.ifc</Name>
<RepresentationContexts ex:cType="set">
<IfcGeometricRepresentationContext pos="0" xsi:nil="true" ref="i1524"/>
</RepresentationContexts>
<UnitsInContext>
<IfcUnitAssignment xsi:nil="true" ref="i1518"/>
</UnitsInContext>
</IfcProject>