Commit 5c4fdf91 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Conversion of SimStadt library (xml) to new catalog format (xmi)

parent e2400453
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/buildingPhysicsLibrary">
<buildphys:BuildingPhysicsCatalog xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:buildphys="http://www.hftstuttgart.de/buildingphysics"
author="Verena Weiler, HfT Stuttgart">
<xsl:apply-templates select="windowLib" />
<xsl:apply-templates select="constructionLib" />
</buildphys:BuildingPhysicsCatalog>
</xsl:template>
<xsl:template match="windowLib">
<xsl:element name="windowCatalog">
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="description"><xsl:value-of select="description" /></xsl:attribute>
<xsl:attribute name="source"><xsl:value-of select="source" /></xsl:attribute>
<xsl:for-each select="windowType">
<xsl:element name="windowTypes">
<xsl:attribute name="windowTypeId">
<xsl:value-of select="'window_'" /><xsl:value-of select="id" /></xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="uValue"><xsl:value-of select="uValue" />
<xsl:value-of select="' W/(m²·K)'" /></xsl:attribute>
<xsl:attribute name="glazingNumber"><xsl:value-of select="glazingNumber" /></xsl:attribute>
<xsl:attribute name="frameRatio"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="embodiedEnergy"><xsl:value-of select="embodiedEnergy" />
<xsl:value-of select="' kW·h/m²'" /></xsl:attribute>
<xsl:attribute name="embodiedCarbon"><xsl:value-of select="embodiedCarbon" />
<xsl:value-of select="' kg'" /></xsl:attribute>
<xsl:attribute name="constructionDescription"><xsl:value-of select="constructionDescription" /></xsl:attribute>
<xsl:attribute name="disposalEnergy"><xsl:value-of select="disposalEnergy" />
<xsl:value-of select="' kW·h/m²'" /></xsl:attribute>
<xsl:attribute name="disposalCarbon"><xsl:value-of select="disposalCarbon" />
<xsl:value-of select="' kg'" /></xsl:attribute>
<xsl:attribute name="disposalDescription"><xsl:value-of select="disposalDescription" /></xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template match="constructionLib">
<xsl:element name="materialCatalog">
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="description"><xsl:value-of select="description" /></xsl:attribute>
<xsl:attribute name="source"><xsl:value-of select="source" /></xsl:attribute>
<xsl:apply-templates select="materialCategory" />
<xsl:apply-templates select="constructionCategory" />
</xsl:element>
</xsl:template>
<xsl:template match="materialCategory">
<xsl:element name="materialCategories">
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:apply-templates select="material" />
</xsl:element>
</xsl:template>
<xsl:template match="material">
<xsl:element name="materials">
<xsl:attribute name="materialId">
<xsl:value-of select="'material_'" /><xsl:value-of select="id" />
</xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:attribute name="density"><xsl:value-of select="density" />
<xsl:value-of select="' kg/m³'" /></xsl:attribute>
<xsl:attribute name="heatCapacity"><xsl:value-of select="heatCapacity" />
<xsl:value-of select="' J/K'" /></xsl:attribute>
<xsl:attribute name="conductivity"><xsl:value-of select="conductivity" />
<xsl:value-of select="' W/(m·K)'" /></xsl:attribute>
<xsl:attribute name="embodiedEnergy"><xsl:value-of select="embodiedEnergy" />
<xsl:value-of select="' kW·h/kg'" /></xsl:attribute>
<xsl:attribute name="embodiedCarbon"><xsl:value-of select="embodiedCarbon" />
<xsl:value-of select="' kg'" /></xsl:attribute>
<xsl:attribute name="constructionDescription"><xsl:value-of select="constructionDescription" /></xsl:attribute>
<xsl:attribute name="disposalEnergy"><xsl:value-of select="disposalEnergy" />
<xsl:value-of select="' kW·h/kg'" /></xsl:attribute>
<xsl:attribute name="disposalCarbon"><xsl:value-of select="disposalCarbon" />
<xsl:value-of select="' kg'" /></xsl:attribute>
<xsl:attribute name="disposalDescription"><xsl:value-of select="disposalDescription" /></xsl:attribute>
</xsl:element>
</xsl:template>
<xsl:template match="constructionCategory">
<xsl:element name="constructionCategories">
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:apply-templates select="constructionType" />
</xsl:element>
</xsl:template>
<xsl:template match="constructionType">
<xsl:element name="mountings">
<xsl:attribute name="mountingId">
<xsl:value-of select="'mounting_'" /><xsl:value-of select="id" />
</xsl:attribute>
<xsl:attribute name="name"><xsl:value-of select="name" /></xsl:attribute>
<xsl:apply-templates select="layer" />
</xsl:element>
</xsl:template>
<xsl:template match="layer">
<xsl:element name="layers">
<xsl:attribute name="material">
<xsl:value-of select="'material_'" /><xsl:value-of select="materialId" />
</xsl:attribute>
<xsl:attribute name="thickness"><xsl:value-of select="thickness" />
<xsl:value-of select="' m'" /></xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment