You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
4.6 KiB
96 lines
4.6 KiB
2 years ago
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||
|
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
|
||
|
<xsl:variable name="hochkomma"><xsl:text>'</xsl:text></xsl:variable>
|
||
|
<xsl:template match="/">
|
||
|
<xsl:text>
</xsl:text>
|
||
|
<xsl:comment>Automatisch generiert von Edustore durch tabelle_xml_mondrian3.xsl </xsl:comment>
|
||
|
<xsl:text>
</xsl:text>
|
||
|
<Schema name="SuperX">
|
||
|
<xsl:text>
</xsl:text>
|
||
|
<xsl:choose>
|
||
|
<xsl:when test="/ergebnisse/ergebnis/ergebniselement/sqlerg/row/col[@id='0']/wert !=''">
|
||
|
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement/sqlerg/row[col[f_name='is_fact_table_aggr_field']/wert='0']">
|
||
|
<xsl:variable name="hasAll">
|
||
|
<xsl:choose>
|
||
|
<xsl:when test="col[f_name='is_summable']/wert = '0'">false</xsl:when>
|
||
|
<xsl:otherwise>true</xsl:otherwise>
|
||
|
</xsl:choose>
|
||
|
</xsl:variable>
|
||
|
<xsl:choose>
|
||
|
<xsl:when test="col[f_name='foreignkey_tab']/wert !=''">
|
||
|
<!-- mit Dim-Tabelle-->
|
||
|
|
||
|
<Dimension caption="{col[f_name='fact_table_field_caption']/wert}" name="{col[f_name='fact_table_field_name']/wert}">
|
||
|
<Hierarchy hasAll="{$hasAll}" primaryKey="{col[f_name='foreignkey_pk_col']/wert}" caption="{col[f_name='foreignkey_cap']/wert}" name="{concat(col[f_name='foreignkey_tab']/wert,'_',col[f_name='fact_table_field_name']/wert)}">
|
||
|
<xsl:if test="$hasAll = 'true'"><xsl:attribute name="allMemberName">Insgesamt</xsl:attribute></xsl:if>
|
||
|
<Table name="{col[f_name='foreignkey_tab']/wert}" alias="{col[f_name='foreignkey_tab']/wert}">
|
||
|
<xsl:if test="col[f_name='foreignkey_cond']/wert != ''">
|
||
|
<SQL><xsl:value-of select="col[f_name='foreignkey_cond']/wert"/></SQL>
|
||
|
</xsl:if>
|
||
|
</Table>
|
||
|
<Level caption="{concat(col[f_name='fact_table_field_caption']/wert,' (Details)')}" name="{col[f_name='foreignkey_tab']/wert}_{col[f_name='fact_table_field_name']/wert}"
|
||
|
nameColumn="{col[f_name='foreignkey_name_col']/wert}"
|
||
|
column="{col[f_name='foreignkey_pk_col']/wert}"
|
||
|
ordinalColumn="{col[f_name='foreignkey_ordinal_col']/wert}"
|
||
|
uniqueMembers="true" />
|
||
|
|
||
|
</Hierarchy>
|
||
|
|
||
|
|
||
|
</Dimension>
|
||
|
</xsl:when>
|
||
|
<xsl:otherwise>
|
||
|
<!-- degenerate Dimension -->
|
||
|
<Dimension caption="{col[f_name='fact_table_field_caption']/wert}" name="{col[f_name='fact_table_field_name']/wert}">
|
||
|
<Hierarchy hasAll="{$hasAll}">
|
||
|
<xsl:if test="$hasAll = 'true'"><xsl:attribute name="allMemberName">Insgesamt</xsl:attribute></xsl:if>
|
||
|
<Level caption="{concat(col[f_name='fact_table_field_caption']/wert,' (Details)')}" name="{col[f_name='fact_table_field_name']/wert}"
|
||
|
column="{col[f_name='fact_table_field_name']/wert}" ordinalColumn="{col[f_name='fact_table_field_name']/wert}"
|
||
|
uniqueMembers="true" />
|
||
|
|
||
|
</Hierarchy>
|
||
|
</Dimension>
|
||
|
</xsl:otherwise>
|
||
|
</xsl:choose>
|
||
|
</xsl:for-each>
|
||
|
|
||
|
<Cube name="{/ergebnisse/ergebnis/ergebniselement/sqlerg/row[@no='0']/col[f_name='fact_table_name']/wert}" caption="{/ergebnisse/ergebnis/ergebniselement/sqlerg/row[@no='0']/col[f_name='fact_table_caption']/wert}">
|
||
|
<Table name="{/ergebnisse/ergebnis/ergebniselement/sqlerg/row[@no='0']/col[f_name='fact_table_name']/wert}"/>
|
||
|
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement/sqlerg/row[col[f_name='is_fact_table_aggr_field']/wert='0']">
|
||
|
<DimensionUsage name="{concat('dim_',col[f_name='fact_table_field_name']/wert)}" source="{col[f_name='fact_table_field_name']/wert}" foreignKey="{col[f_name='fact_table_field_name']/wert}"/>
|
||
|
</xsl:for-each>
|
||
|
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement/sqlerg/row[col[f_name='is_fact_table_aggr_field']/wert='1']">
|
||
|
<Measure name="{col[f_name='fact_table_field_caption']/wert}" column="{col[f_name='fact_table_field_name']/wert}" aggregator="{col[f_name='fact_table_aggr_function']/wert}"/>
|
||
|
</xsl:for-each>
|
||
|
<!--
|
||
|
<Measure name="Anzahl (Köpfe)" aggregator="sum" formatString="#,###">
|
||
|
<MeasureExpression>
|
||
|
<SQL dialect="generic">
|
||
|
(case when studiengang_nr=1 and fach_nr=1 then summe else 0 end)
|
||
|
</SQL>
|
||
|
</MeasureExpression>
|
||
|
</Measure>
|
||
|
-->
|
||
|
</Cube>
|
||
|
</xsl:when>
|
||
|
<xsl:otherwise>
|
||
|
<xsl:comment>No cubes found</xsl:comment>
|
||
|
</xsl:otherwise>
|
||
|
</xsl:choose>
|
||
|
</Schema>
|
||
|
</xsl:template>
|
||
|
<!--currently not used: remove .,' and = -->
|
||
|
<xsl:template name="escapeCondition">
|
||
|
<xsl:param name="wert" />
|
||
|
<xsl:variable name="ohnePunkt"><xsl:call-template name="escapePunkt">
|
||
|
<xsl:with-param name="wert" select="$wert"/>
|
||
|
</xsl:call-template></xsl:variable>
|
||
|
<xsl:value-of select="replace(replace($ohnePunkt,$hochkomma,'_'),'=','_')"/>
|
||
|
</xsl:template>
|
||
|
<xsl:template name="escapePunkt">
|
||
|
<xsl:param name="wert" />
|
||
|
<xsl:value-of select="concat(substring-before($wert,'.'),'_',substring-after($wert,'.'))" />
|
||
|
</xsl:template>
|
||
|
</xsl:stylesheet>
|