Commit 59529161 authored by Steffen Wallner's avatar Steffen Wallner

beta release KIT Tool | EneffBIM converter 2016 Version 0.1 notes: please...

beta release KIT Tool | EneffBIM converter 2016  Version 0.1 notes: please notice the README file in the IFCtoSimModel/KIT/EneffBIMconverter folder as it describes how to execute the application. With this release the corresponding generated Simmodel files to the current BIM model files in the EnEffBIM_UseCases repository (GitHub: commit d2a9c5b) can be found in the output subfolders of IFCtoSimModel/KIT/EneffBIMconverter/DIST and ('Debug-Version') IFCtoSimModel/KIT/EneffBIMconverter/Development.
parent 11c2bb53
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM) IfcActor.xsl 29.2.2016 --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc"> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="ifc:IfcActor"> <xsl:param name="KeyPool"/> <xsl:if test="$KeyPool != ''"> <xsl:variable name="simelemname"> <xsl:call-template name="getSimElementName"> <xsl:with-param name="KeyPool" select="$KeyPool"/> </xsl:call-template> </xsl:variable> <xsl:variable name="targetelements"> <xsl:call-template name="resolvekeypool"> <xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/> <xsl:with-param name="elemname" select="'name'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="GenerateIfcElement"> <xsl:with-param name="KeyPool" select="$KeyPool"/> <xsl:with-param name="simelemname" select="$simelemname"/> <xsl:with-param name="pregens" select="$targetelements"/> </xsl:call-template> </xsl:if> </xsl:template></xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM) IfcOccupant.xsl 29.2.2016 --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc"> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="ifc:IfcOccupant"> <xsl:param name="KeyPool"/> <xsl:if test="$KeyPool != ''"> <xsl:variable name="simelemname"> <xsl:call-template name="getSimElementName"> <xsl:with-param name="KeyPool" select="$KeyPool"/> </xsl:call-template> </xsl:variable> <xsl:variable name="targetelements"> <xsl:call-template name="resolvekeypool"> <xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/> <xsl:with-param name="elemname" select="'name'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="GenerateIfcElement"> <xsl:with-param name="KeyPool" select="$KeyPool"/> <xsl:with-param name="simelemname" select="$simelemname"/> <xsl:with-param name="pregens" select="$targetelements"/> </xsl:call-template> </xsl:if> </xsl:template></xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM) IfcTank.xsl 29.2.2016 --><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc"> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="ifc:IfcTank"> <xsl:param name="KeyPool"/> <xsl:if test="$KeyPool != ''"> <xsl:variable name="simelemname"> <xsl:call-template name="getSimElementName"> <xsl:with-param name="KeyPool" select="$KeyPool"/> </xsl:call-template> </xsl:variable> <xsl:variable name="targetelements"> <xsl:call-template name="resolvekeypool"> <xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/> <xsl:with-param name="elemname" select="'name'"/> </xsl:call-template> </xsl:variable> <xsl:call-template name="GenerateIfcElement"> <xsl:with-param name="KeyPool" select="$KeyPool"/> <xsl:with-param name="simelemname" select="$simelemname"/> <xsl:with-param name="pregens" select="$targetelements"/> </xsl:call-template> </xsl:if> </xsl:template></xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- XSLT-Stylesheet to Generate a List of all Properies and a List of duplicate Properties -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="xsl ifc msxsl">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template name="GenerateDuplicateList">
<xsl:param name="PSByRelDef"/>
<xsl:param name="PSByType"/>
<!--CASE 1: Properties are directly referenced-->
<xsl:for-each select="msxsl:node-set($PSByType)/ifc:IfcPropertySet/ifc:HasProperties/ifc:IfcPropertySingleValue">
<xsl:variable name="Name" select="@Name"/>
<xsl:variable name="psetName" select="../../@Name"/>
<xsl:variable name="psetGlobalID" select="../../@GlobalId"/>
<xsl:for-each select="msxsl:node-set($PSByRelDef)/ifc:IfcPropertySet/ifc:HasProperties/ifc:IfcPropertySingleValue">
<xsl:variable name="RelDefPropertyName" select="@Name"/>
<xsl:variable name="RelDefPropertySetName" select="../../@Name"/>
<xsl:if test="current()[contains(../../@Name, $psetName)]">
<xsl:if test="$Name = $RelDefPropertyName">
<xsl:text>
</xsl:text>
<xsl:value-of select="$psetGlobalID"/>:<xsl:value-of select="$psetName"/>:<xsl:value-of select="$Name"/>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
<!--CASE 2: Properties are defined by relation-->
<xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="ConcatPsetCollections">
<xsl:param name="PSByRelDef"/>
<xsl:param name="PSByType"/>
<xsl:copy-of select="$PSByRelDef"/>
<xsl:copy-of select="$PSByType"/>
</xsl:template>
</xsl:stylesheet>
@echo off
cscript Main.js //Nologo %1
/* KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)
* main.js
*
* JScript zur Transformation einer IFC Quelldatei in das designierte Zielformat durch den Einsatz von xsl stylesheet
*/var args = WScript.Arguments;
if (args.length == 0) {
WScript.Echo("Syntaxfehler.");
WScript.Quit();
}
// command-line argumente auslesen
filename = args(0); // Quelldatei
try {
// XML Objekt fr die Quelldatei erzeugen
var xml = new ActiveXObject("Msxml2.DOMDocument.6.0");
xml.async = false;
xml.validateOnParse = true;
xml.load(filename);
WScript.Echo("source XML load succeeded.");
// Einlesevorgang Quelldatei error handling
if (xml.parseError.errorCode != 0) {
WScript.Echo(xml.parseError.reason);
WScript.Quit()
}
// XSLT-Stylesheet laden
var xsl = new ActiveXObject("Msxml2.DOMDocument.6.0");
xsl.async = false;
xsl.resolveExternals = true; // xsl:include zulassen
xsl.setProperty("AllowXsltScript", true); // Skripte erlauben
////////////////
xsl.setProperty("AllowDocumentFunction", true); // document() Funktion erlauben
///////////////
xsl.validateOnParse = true;
xsl.load("xsl\\Main.xsl"); // "Statisch verdrahteter" Einstiegspunkt in XSLT Geflecht
WScript.Echo("XSL load succeeded.");
// Einlesevorgang XSLT error handling
if (xsl.parseError.errorCode != 0) {
WScript.Echo(xsl.parseError.reason);
WScript.Quit()
}
// Objekt fr Zieldokument erzeugen
var result = new ActiveXObject("Msxml2.DOMDocument.6.0");
// Speichere Startzeit
var sTime = new Date();
// Quelldatei TRANSFORMieren
WScript.Echo("Started Transformation.");
xml.transformNodeToObject(xsl.documentElement, result);
WScript.Echo("Transformation succeeded.");
var eTime = new Date();
var elapsed = (eTime.getTime() - sTime.getTime()) / 1000;
WScript.Echo("Transformation took " + elapsed + " seconds.");
// Zieldokument in UTF-8-Stream schreiben
var utf8Stream = new ActiveXObject("ADODB.Stream");
fso = new ActiveXObject("Scripting.FileSystemObject");
utf8Stream.Type = 2; // adTypeText
utf8Stream.Charset = "utf-8"
utf8Stream.LineSeparator = 10; // adLF
utf8Stream.Open();
utf8Stream.WriteText(result.xml);
utf8Stream.Position = 3; // Byte Order Mark berspringen
utf8Stream.SaveToFile("output\\" + fso.GetBaseName(filename) + ".simxml", 2); // adSaveCreateOverWrite
WScript.Echo("Transformation result saved to OUTPUT folder.");
utf8Stream.Close();
}
catch (err) {
WScript.Echo(err.description);
}
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--the IfcActor template-->
<xsl:template match="ifc:IfcActor">
<xsl:param name="KeyPool"/>
<xsl:if test="$KeyPool != ''">
<xsl:variable name="simelemname">
<xsl:call-template name="getSimElementName">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="targetelements">
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!-- generate current's target elements specific fields and attributes (e.g. UniqueId)-->
<!--<xsl:copy>-->
<xsl:call-template name="resolvekeypool">
<xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/>
<xsl:with-param name="elemname" select="'name'"/>
</xsl:call-template>
<!--</xsl:copy>-->
</xsl:variable>
<!--Call the Generic Generation Template-->
<xsl:call-template name="GenerateIfcElement">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
<xsl:with-param name="simelemname" select="$simelemname"/>
<xsl:with-param name="pregens" select="$targetelements"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--EneffBIM common templates-->
<xsl:include href="../../KeyPoolBuilder/xsl/KeyPoolBuilder.xsl"/>
<xsl:include href="../../KeyPoolHelper/xsl/KeyPoolHelper.xsl"/>
<xsl:include href="../../KeyBoundElementGenerator/xsl/KeyBoundElementGenerator.xsl"/>
<xsl:include href="../../SimXsdRrepository/xsl/SimXsdRrepository.xsl"/>
<!--IFC common templates-->
<xsl:include href="../../IfcPropertySet/xsl/IfcPropertySet.xsl"/>
<xsl:include href="../../IfcType/xsl/IfcType.xsl"/>
<xsl:include href="../../IfcHelper/xsl/IfcHelper.xsl"/>
<xsl:include href="../../ifcXML/xsl/ifcXML.xsl"/>
<!--nested IFC Object traversal templates-->
<xsl:include href="../../IfcProject/xsl/IfcProject.xsl"/>
<xsl:include href="../../IfcSite/xsl/IfcSite.xsl"/>
<xsl:include href="../../IfcBuilding/xsl/IfcBuilding.xsl"/>
<xsl:include href="../../IfcBuildingStorey/xsl/IfcBuildingStorey.xsl"/>
<xsl:include href="../../IfcSpace/xsl/IfcSpace.xsl"/>
<!--IFC object transformation templates-->
<!--<xsl:include href="../../IfcBuildingSystem/xsl/IfcBuildingSystem.xsl"/>
<xsl:include href="../../IfcDistributionSystem/xsl/IfcDistributionSystem.xsl"/>
<xsl:include href="../../IfcDistributionPort/xsl/IfcDistributionPort.xsl"/>
<xsl:include href="../../IfcRelConnectsPorts/xsl/IfcRelConnectsPorts.xsl"/>
<xsl:include href="../../IfcSpaceHeater/xsl/IfcSpaceHeater.xsl"/>
<xsl:include href="../../IfcOccupant/xsl/IfcOccupant.xsl"/>-->
<xsl:include href="../../IfcActor/xsl/IfcActor.xsl"/>
<!--<xsl:include href="../../IfcBoiler/xsl/IfcBoiler.xsl"/>
<xsl:include href="../../IfcTank/xsl/IfcTank.xsl"/>
<xsl:include href="../../IfcValve/xsl/IfcValve.xsl"/>
<xsl:include href="../../IfcPump/xsl/IfcPump.xsl"/>
<xsl:include href="../../IfcPipeSegment/xsl/IfcPipeSegment.xsl"/>
<xsl:include href="../../IfcPipeFitting/xsl/IfcPipeFitting.xsl"/>-->
<xsl:template match="/">
<!--<xsl:apply-templates/>-->
<xsl:if test="ifc:ifcXML">
<xsl:call-template name="ifcXML"/>
</xsl:if>
</xsl:template>
<!--prevent text() output if no template matching the type is present in xslt constellation-->
<xsl:template match="text()"/>
</xsl:stylesheet>
@echo off
cscript Main.js //Nologo %1
/* KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)
* main.js
*
* JScript zur Transformation einer IFC Quelldatei in das designierte Zielformat durch den Einsatz von xsl stylesheet
*/var args = WScript.Arguments;
if (args.length == 0) {
WScript.Echo("Syntaxfehler.");
WScript.Quit();
}
// command-line argumente auslesen
filename = args(0); // Quelldatei
try {
// XML Objekt fr die Quelldatei erzeugen
var xml = new ActiveXObject("Msxml2.DOMDocument.6.0");
xml.async = false;
xml.validateOnParse = true;
xml.load(filename);
WScript.Echo("source XML load succeeded.");
// Einlesevorgang Quelldatei error handling
if (xml.parseError.errorCode != 0) {
WScript.Echo(xml.parseError.reason);
WScript.Quit()
}
// XSLT-Stylesheet laden
var xsl = new ActiveXObject("Msxml2.DOMDocument.6.0");
xsl.async = false;
xsl.resolveExternals = true; // xsl:include zulassen
xsl.setProperty("AllowXsltScript", true); // Skripte erlauben
////////////////
xsl.setProperty("AllowDocumentFunction", true); // document() Funktion erlauben
///////////////
xsl.validateOnParse = true;
xsl.load("xsl\\Main.xsl"); // "Statisch verdrahteter" Einstiegspunkt in XSLT Geflecht
WScript.Echo("XSL load succeeded.");
// Einlesevorgang XSLT error handling
if (xsl.parseError.errorCode != 0) {
WScript.Echo(xsl.parseError.reason);
WScript.Quit()
}
// Objekt fr Zieldokument erzeugen
var result = new ActiveXObject("Msxml2.DOMDocument.6.0");
// Speichere Startzeit
var sTime = new Date();
// Quelldatei TRANSFORMieren
WScript.Echo("Started Transformation.");
xml.transformNodeToObject(xsl.documentElement, result);
WScript.Echo("Transformation succeeded.");
var eTime = new Date();
var elapsed = (eTime.getTime() - sTime.getTime()) / 1000;
WScript.Echo("Transformation took " + elapsed + " seconds.");
// Zieldokument in UTF-8-Stream schreiben
var utf8Stream = new ActiveXObject("ADODB.Stream");
fso = new ActiveXObject("Scripting.FileSystemObject");
utf8Stream.Type = 2; // adTypeText
utf8Stream.Charset = "utf-8"
utf8Stream.LineSeparator = 10; // adLF
utf8Stream.Open();
utf8Stream.WriteText(result.xml);
utf8Stream.Position = 3; // Byte Order Mark berspringen
utf8Stream.SaveToFile("output\\" + fso.GetBaseName(filename) + ".simxml", 2); // adSaveCreateOverWrite
WScript.Echo("Transformation result saved to OUTPUT folder.");
utf8Stream.Close();
}
catch (err) {
WScript.Echo(err.description);
}
<?xml version="1.0" encoding="utf-8"?>
<!-- KIT Tool | EneffBIM converter (Author KIT BLM 2015)-->
<!-- XSLT-Stylesheet Transformation from IfcBoiler to the aquivalent SimModel type -->
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--the IfcBoiler template-->
<xsl:template match="ifc:IfcBoiler">
<xsl:param name="KeyPool"/>
<xsl:if test="$KeyPool != ''">
<xsl:variable name="simelemname">
<xsl:call-template name="getSimElementName">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="targetelements">
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!-- generate current's target elements specific fields and attributes (e.g. UniqueId)-->
<!--<xsl:copy>-->
<xsl:call-template name="resolvekeypool">
<xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/>
<xsl:with-param name="elemname" select="'name'"/>
</xsl:call-template><!--</xsl:copy>-->
</xsl:call-template>
<!--</xsl:copy>-->
</xsl:variable>
<!--Call the Generic Generation Template-->
<xsl:call-template name="GenerateIfcElement">
......@@ -31,9 +28,6 @@
<xsl:with-param name="simelemname" select="$simelemname"/>
<xsl:with-param name="pregens" select="$targetelements"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--EneffBIM common templates-->
<xsl:include href="../../KeyPoolBuilder/xsl/KeyPoolBuilder.xsl"/>
<xsl:include href="../../KeyPoolHelper/xsl/KeyPoolHelper.xsl"/>
<xsl:include href="../../KeyBoundElementGenerator/xsl/KeyBoundElementGenerator.xsl"/>
<xsl:include href="../../SimXsdRrepository/xsl/SimXsdRrepository.xsl"/>
<!--IFC common templates-->
<xsl:include href="../../IfcPropertySet/xsl/IfcPropertySet.xsl"/>
<xsl:include href="../../IfcType/xsl/IfcType.xsl"/>
<xsl:include href="../../IfcHelper/xsl/IfcHelper.xsl"/>
<xsl:include href="../../ifcXML/xsl/ifcXML.xsl"/>
<!--nested IFC Object traversal templates-->
<xsl:include href="../../IfcProject/xsl/IfcProject.xsl"/>
<xsl:include href="../../IfcSite/xsl/IfcSite.xsl"/>
<xsl:include href="../../IfcBuilding/xsl/IfcBuilding.xsl"/>
<xsl:include href="../../IfcBuildingStorey/xsl/IfcBuildingStorey.xsl"/>
<xsl:include href="../../IfcSpace/xsl/IfcSpace.xsl"/>
<!--IFC object transformation templates-->
<!--<xsl:include href="../../IfcBuildingSystem/xsl/IfcBuildingSystem.xsl"/>
<xsl:include href="../../IfcDistributionSystem/xsl/IfcDistributionSystem.xsl"/>
<xsl:include href="../../IfcDistributionPort/xsl/IfcDistributionPort.xsl"/>
<xsl:include href="../../IfcRelConnectsPorts/xsl/IfcRelConnectsPorts.xsl"/>
<xsl:include href="../../IfcSpaceHeater/xsl/IfcSpaceHeater.xsl"/>
<xsl:include href="../../IfcOccupant/xsl/IfcOccupant.xsl"/>
<xsl:include href="../../IfcActor/xsl/IfcActor.xsl"/>-->
<xsl:include href="../../IfcBoiler/xsl/IfcBoiler.xsl"/>
<!--<xsl:include href="../../IfcTank/xsl/IfcTank.xsl"/>
<xsl:include href="../../IfcValve/xsl/IfcValve.xsl"/>
<xsl:include href="../../IfcPump/xsl/IfcPump.xsl"/>
<xsl:include href="../../IfcPipeSegment/xsl/IfcPipeSegment.xsl"/>
<xsl:include href="../../IfcPipeFitting/xsl/IfcPipeFitting.xsl"/>-->
<xsl:template match="/">
<!--<xsl:apply-templates/>-->
<xsl:if test="ifc:ifcXML">
<xsl:call-template name="ifcXML"/>
</xsl:if>
</xsl:template>
<!--prevent text() output if no template matching the type is present in xslt constellation-->
<xsl:template match="text()"/>
</xsl:stylesheet>
/*
* ifcXML.js
/* KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM)
* main.js
*
* JScript zur zur Transformation einer Quelldatei zur designierten Zieldatei mithilfe xsl stylesheet
* JScript zur Transformation einer IFC Quelldatei in das designierte Zielformat durch den Einsatz von xsl stylesheet
*/
var args = WScript.Arguments;
......@@ -35,8 +35,11 @@ try {
xsl.async = false;
xsl.resolveExternals = true; // xsl:include zulassen
xsl.setProperty("AllowXsltScript", true); // Skripte erlauben
////////////////
xsl.setProperty("AllowDocumentFunction", true); // document() Funktion erlauben
///////////////
xsl.validateOnParse = true;
xsl.load("..\\Main\\xsl\\Main.xsl"); // "Statisch verdrahteter" Einstiegspunkt in XSLT Geflecht
xsl.load("xsl\\Main.xsl"); // "Statisch verdrahteter" Einstiegspunkt in XSLT Geflecht
WScript.Echo("XSL load succeeded.");
// Einlesevorgang XSLT error handling
if (xsl.parseError.errorCode != 0) {
......@@ -47,11 +50,16 @@ try {
// Objekt fr Zieldokument erzeugen
var result = new ActiveXObject("Msxml2.DOMDocument.6.0");
// Speichere Startzeit
var sTime = new Date();
// Quelldatei TRANSFORMieren
WScript.Echo("Started Transformation.");
xml.transformNodeToObject(xsl.documentElement, result);
WScript.Echo("Transformation succeeded.");
var eTime = new Date();
var elapsed = (eTime.getTime() - sTime.getTime()) / 1000;
WScript.Echo("Transformation took " + elapsed + " seconds.");
// Zieldokument in UTF-8-Stream schreiben
var utf8Stream = new ActiveXObject("ADODB.Stream");
......
<?xml version="1.0" encoding="utf-8"?>
<!-- XSLT-Stylesheet Transformation of the ifcBoiler type to the SimModel aquivalent Type-->
<!-- KIT Tool | EneffBIM converter 2016 Version 0.1 (Author KIT BLM) -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.lbl.gov/namespaces/Sim/Model" xmlns:simcore="http://www.lbl.gov/namespaces/Sim/SimModelCore" xmlns:simres="http://www.lbl.gov/namespaces/Sim/ResourcesGeneral" xmlns:simgeom="http://www.lbl.gov/namespaces/Sim/ResourcesGeometry" xmlns:simbldg="http://www.lbl.gov/namespaces/Sim/BuildingModel" xmlns:simmep="http://www.lbl.gov/namespaces/Sim/MepModel" xmlns:ifc="http://www.buildingsmart-tech.org/ifcXML/IFC4/Add1" exclude-result-prefixes="xsl ifc">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--the IfcBoiler template-->
<xsl:template match="ifc:IfcBuilding" name="GetIfcBuilding" mode="traverse">
<!--Check wether matched Boiler is instance (else ignore reference object with @ref="...")-->
<xsl:if test="current()[@GlobalId]">
<!--@id -> This is misplaced: here only generation - eval wether id/ref (or Tag/ObjectType) should not take place here -> because by calling template current() is implicitly transfered and the attributes are commonly inherited from base class (so the resolving templates e.g. IfcType can check them uniformly)-->
<xsl:for-each select=".">
<!--<xsl:element name="SimBuilding">-->
<!--<xsl:value-of select="$KeyPool"/>-->
<xsl:if test="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects != ''">
<!--<xsl:variable name="BuildRelatedObjects" select="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects"/>
<!--Check wether matched Boiler is instance (else ignore reference object with @ref="...")-->
<xsl:if test="current()[@GlobalId]">
<!--@id -> This is misplaced: here only generation - eval wether id/ref (or Tag/ObjectType) should not take place here -> because by calling template current() is implicitly transfered and the attributes are commonly inherited from base class (so the resolving templates e.g. IfcType can check them uniformly)-->
<xsl:for-each select=".">
<!--<xsl:element name="SimBuilding">-->
<!--<xsl:value-of select="$KeyPool"/>-->
<xsl:if test="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects != ''">
<!--<xsl:variable name="BuildRelatedObjects" select="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects"/>
<xsl:for-each select="$BuildRelatedObjects/ifc:IfcBuildingStorey">
<xsl:call-template name="GetIfcBuildingStorey">
</xsl:call-template>
</xsl:for-each>-->
<xsl:for-each select="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects/node()">
<xsl:apply-templates select="current()" mode="traverse"/>
</xsl:for-each>
</xsl:if>
<!--</xsl:element>-->
</xsl:for-each>
</xsl:if>
<xsl:for-each select="current()/ifc:IsDecomposedBy/ifc:IfcRelAggregates/ifc:RelatedObjects/node()">
<xsl:apply-templates select="current()" mode="traverse"/>
</xsl:for-each>
</xsl:if>
<!--</xsl:element>-->
</xsl:for-each>
</xsl:if>
</xsl:template>
<xsl:template match="ifc:IfcBuilding">
<xsl:param name="KeyPool"/>
<xsl:if test="$KeyPool != ''">
<xsl:variable name="simelemname">
<xsl:call-template name="getSimElementName">
<xsl:with-param name="KeyPool" select="$KeyPool"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="targetelements">
<!--<xsl:element name="simcore:SimUniqueID">TTT</xsl:element>-->
<!-- generate current's target elements specific fields and attributes (e.g. UniqueId)-->
<!--<xsl:copy>-->
<xsl:call-template name="resolvekeypool">
<xsl:with-param name="KeyPoolSnippet" select="$KeyPool"/>
<xsl:with-param name="elemname" select="'name'"/>
</xsl:call-template>