Example: Working with P28 XML Configurations
The Part 28 XML configuration file is responsible for styling the output P28 file. If the XML configuration file is not available, default values will be used, meaning basically no styling at all. The control language within the XML configuration file specifies how the EXPRESS Schema is represented in an XML schema and how instances are rendered into the XML elements.
The sample below shows a typical XML configuration file
<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) --> <configuration xmlns:ex="urn:iso10303-28:ex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso10303-28:ex D:\IFC\IFC_Doc\xml\xml2\p28_config.xsd" id="i-ifc2x2"> <option inheritance="true" exp-type="unspecified" exp-attribute="double-tag" flatten="false" sparse="true" tagless="false" naming-convention="preserve-case"/> <type select="LOGICAL" map="xs:double"/> </configuration>
The section above lists the implemented P28 parts
Note: Other configuration options from P28 are allowed in the configuration file but they will not be noticed by the EDM XML pre/post processor. (for instance options that are only relevant for XML schema generation).
<configuration>
The defaults of all configuration options are according to the default XML schema binding (ISO10303-Part28 chapter 7). So if you do not specify a configuration you get a XML confirming to default XML schema. Use attribute inverseAttributes to Produce XML for all inverse attributes. individuals can be excluded/included within the Attributes entity. Use attribute derivedAttributes to Produce XML for all derived attributes. individuals can be excluded/included within the Attributes entity. Use uosNamespace to define the namespace name to be used as for the uos namespace.
- Attributes: id, schema, targetNamespace, prefixNodes, prefixNodesButNotAttributes, uosNodeInTargetNamespace, derivedAttributes, inverseAttributes, uosNamespace, expNamespace, docNamespace, xsiNamespace, xsiSchemaLocatio.
- Nodes: <option>, <type>, <entity> , <uosElement>
<option>
- Attributes: exp-type, tagless, namingConvention
<type>
Note that for attribute select, regular expressions confirming to XML Schema part 2 appendix F is legal for the select attribute (EDM specific)
- Attributes: select, name, map
<entity>
Note that for attribute select, regular expressions confirming to XML Schema part 2 appendix F is legal for the select attribute (EDM specific)
- Attributes: select, name, tagless, flatten, include, exclude
- Nodes: <option>, <type>, <entity>, <uosElement>
<uosElement>
- Attributes: No attributes
<attribute>
Note that for attribute select, regular expressions confirming to XML Schema part 2 appendix F is legal for the select attribute (EDM specific)
- Attributes: select, name
<inverse>
Note that for attribute select, regular expressions confirming to XML Schema part 2 appendix F is legal for the select attribute (EDM specific)
- Attributes: select, name, include, exclude
Defining an XML configuration
This sample shows how to load an XML configuration into the EDMdatabase. The XML configuration may then be used to style the XML when exporting data to XML files. To run this sample, you need to have the IFC2x3 schema compiled in your EDMdatabase. You also need to import the sample population IfcWall_01.ifc. Finally, you need the file containing your XML configuration.
Add the following code block or similar to your application
Exporting configured XML
This sample shows how export a population of the IFC2x3 schema to XML file using an XML configuration. To run this sample, you need to have the IFC2x3 schema compiled in your EDMdatabase. You also need to import the sample population IfcWall_01.ifc. Finally, you load an XML configuration named "MyXMLConfiguration" into the EDMdatabase.
Add the following code block or similar to your application