123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: CCS
- (c) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:ccs="http://developer.cognos.com/rds/1">
- <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0" cdata-section-elements="ccs:upStyleValue"/>
- <!--***********************************************************
- Parameters
- ***********************************************************-->
- <xsl:param name="transformData" select="'false'"/>
- <!--************************************************************
- Templates
- ************************************************************-->
- <xsl:template match="/">
- <ccs:cbits>
- <ccs:metaData>
- <ccs:id>1</ccs:id>
- <ccs:style/>
- <ccs:name>Report</ccs:name>
- <ccs:type>TopReport</ccs:type>
- <ccs:content>
- <ccs:title/>
- <ccs:topReport>
- <xsl:apply-templates select="data" mode="meta"/>
- </ccs:topReport>
- </ccs:content>
- </ccs:metaData>
- <ccs:data>
- <xsl:choose>
- <xsl:when test="$transformData = 'true' ">
- <ccs:id>1</ccs:id>
- <ccs:style/>
- <ccs:name>Report</ccs:name>
- <ccs:type>TopReport</ccs:type>
- <ccs:content>
- <ccs:title/>
- <ccs:topReport>
- <xsl:apply-templates select="data"/>
- </ccs:topReport>
- </ccs:content>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </ccs:data>
- </ccs:cbits>
- </xsl:template>
- <!-- **********************************************************************
- This section handles data
- **********************************************************************-->
- <xsl:template match="data">
- <!--
- For PP, the foll. hard coded ids hold :
- id 1 : Top Report
- id 2 : Crosstab
- id 3 : Status line
- id 4: Page
- -->
- <ccs:pages>
- <ccs:id>4</ccs:id>
- <ccs:name/>
- <ccs:type>Page</ccs:type>
- <ccs:content>
- <ccs:page>
- <ccs:headerElement/>
- <ccs:bodyElements>
- <ccs:id>2</ccs:id>
- <ccs:name>Crosstab</ccs:name>
- <ccs:type>Table</ccs:type>
- <ccs:content>
- <ccs:table>
- <xsl:apply-templates select="tab/crosstab/datarow"/>
- </ccs:table>
- </ccs:content>
- </ccs:bodyElements>
- <ccs:footerElements>
- <xsl:choose>
- <xsl:when test="normalize-space(tab/status_line/@status)">
- <ccs:id>3</ccs:id>
- <ccs:name>statusLine</ccs:name>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:value>
- <xsl:value-of select="tab/status_line/@status"/>
- </ccs:value>
- <ccs:valueType>text</ccs:valueType>
- </ccs:textFrame>
- </ccs:content>
- </xsl:when>
- </xsl:choose>
- </ccs:footerElements>
- </ccs:page>
- </ccs:content>
- </ccs:pages>
- <ccs:unprocessedStyle>
- <xsl:value-of select="tab/style/@details"/>
- </ccs:unprocessedStyle>
- <xsl:choose>
- <xsl:when test="tab/crosstab/datarow/col/@exception">
- <ccs:hasMoreUStyles>true</ccs:hasMoreUStyles>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <!-- get meta data about the rows or columns, will recurse to get nested rows or columns-->
- <xsl:template match="row">
- <ccs:rows>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:value-of select="@pos"/>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyle"/>
- <xsl:apply-templates mode="contained" select="row"/>
- </ccs:rows>
- </xsl:template>
- <xsl:template match="column">
- <ccs:columns>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:value-of select="@pos"/>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyle"/>
- <xsl:apply-templates mode="contained" select="column"/>
- </ccs:columns>
- </xsl:template>
- <xsl:template mode="contained" match="column|row">
- <ccs:containedGroup>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:value-of select="@pos"/>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyle"/>
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:apply-templates mode="contained" select="row"/>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:apply-templates mode="contained" select="column"/>
- </xsl:when>
- </xsl:choose>
- </ccs:containedGroup>
- </xsl:template>
- <!-- apply the class for the header -->
- <xsl:template name="labelStyle">
- <ccs:style>
- <xsl:choose>
- <xsl:when test="@suppressed">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">8020rowlabelnested</xsl:when>
- <xsl:otherwise>8020rowlabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">8020labelcolnested</xsl:when>
- <xsl:otherwise>8020collabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@calculation">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">calculationrowlabelnested</xsl:when>
- <xsl:otherwise>calculationrowlabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">calculationcollabelnested</xsl:when>
- <xsl:otherwise>calculationcollabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@summary">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summaryrowlabelone</xsl:when>
- <xsl:otherwise>summaryrowlabeltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycollabelone</xsl:when>
- <xsl:otherwise>summarycollabeltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">rowLabelNested</xsl:when>
- <xsl:otherwise>rowLabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">colLabelNested</xsl:when>
- <xsl:otherwise>colLabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:style>
- </xsl:template>
- <!-- get the data rows -->
- <xsl:template match="datarow">
- <ccs:row>
- <ccs:type>Detail</ccs:type>
- <xsl:for-each select="col">
- <ccs:cells>
- <ccs:parts>
- <ccs:id/>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:value>
- <xsl:value-of select="."/>
- </ccs:value>
- <ccs:valueType>number</ccs:valueType>
- <ccs:dataFormat>
- <xsl:value-of select="@format"/>
- </ccs:dataFormat>
- </ccs:textFrame>
- </ccs:content>
- <xsl:call-template name="cellStyle"/>
- </ccs:parts>
- </ccs:cells>
- </xsl:for-each>
- </ccs:row>
- </xsl:template>
- <!-- apply the class for the data cells -->
- <xsl:template name="cellStyle">
- <ccs:style>
- <xsl:choose>
- <xsl:when test="@lowexception">lowexceptioncell</xsl:when>
- <xsl:when test="@highexception">highexceptioncell</xsl:when>
- <xsl:when test="@summary">
- <xsl:choose>
- <xsl:when test="@rank">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycellonerank</xsl:when>
- <xsl:otherwise>summarycelltworank</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@suppressed or @calculation">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycelloneitalic</xsl:when>
- <xsl:otherwise>summarycelltwoitalic</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycellone</xsl:when>
- <xsl:otherwise>summarycelltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@rank">rankcell</xsl:when>
- <xsl:when test="@calculation">calculationcell</xsl:when>
- <xsl:when test="@suppressed">8020cell</xsl:when>
- <xsl:otherwise>cell</xsl:otherwise>
- </xsl:choose>
- </ccs:style>
- <xsl:if test="@exception">
- <ccs:unprocessedStyle>
- <xsl:if test="@fontcolor">
- <xsl:value-of select="concat('color: #', ./@fontcolor, '; ')"/>
- </xsl:if>
- <xsl:if test="@bgcolor">
- <xsl:value-of select="concat('background-color: #', ./@bgcolor, '; ')"/>
- </xsl:if>
- <xsl:if test="@fontSize">
- <xsl:value-of select="concat('font-size: ', ./@fontSize, 'pt; ')"/>
- </xsl:if>
- <xsl:if test="@bold">font-weight: bold; </xsl:if>
- <xsl:if test="@italic">font-style: italic; </xsl:if>
- <xsl:if test="@underline">text-decoration: underline; </xsl:if>
- </ccs:unprocessedStyle>
- </xsl:if>
- </xsl:template>
- <!-- Tokenize the dimension line -->
- <xsl:template match="dimension_line">
- <xsl:call-template name="dimensions">
- <xsl:with-param name="dimStr" select="@details"/>
- </xsl:call-template>
- <ccs:style>dimLine</ccs:style>
- </xsl:template>
- <xsl:template name="dimensions">
- <xsl:param name="dimStr"/>
- <xsl:variable name="nextDim">
- <xsl:choose>
- <xsl:when test="starts-with($dimStr,'[')">
- <xsl:value-of select="substring-before(substring-after($dimStr,'['),']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$dimStr"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="otherDims">
- <xsl:if test="contains($dimStr,'[')">
- <xsl:value-of select="substring-after($dimStr,']')"/>
- </xsl:if>
- </xsl:variable>
- <ccs:dimensions>
- <xsl:value-of select="$nextDim"/>
- </ccs:dimensions>
- <xsl:if test="string-length($otherDims) != 0">
- <xsl:call-template name="dimensions">
- <xsl:with-param name="dimStr" select="$otherDims"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <!--***************************************************************
- This section handles metadata
- **************************************************************** -->
- <xsl:template match="data" mode="meta">
- <!--
- For PP, the foll. hard coded ids hold :
- id 1 : Top Report
- id 2 : Crosstab
- id 3 : Status line
- id 4: Page
- -->
- <ccs:pages>
- <ccs:id>4</ccs:id>
- <ccs:name/>
- <ccs:type>Page</ccs:type>
- <ccs:content>
- <ccs:page>
- <ccs:headerElements/>
- <ccs:bodyElements>
- <ccs:id>2</ccs:id>
- <ccs:style>
- </ccs:style>
- <ccs:name>Crosstab</ccs:name>
- <ccs:type>Table</ccs:type>
- <ccs:content>
- <ccs:table>
- <ccs:isCrossTab>true</ccs:isCrossTab>
- <ccs:moreRows>
- <xsl:choose>
- <xsl:when test="string-length(tab/crosstab/@rowEnd) > 0">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:moreRows>
- <ccs:moreCols>
- <xsl:choose>
- <xsl:when test="string-length(tab/crosstab/@colEnd) > 0">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:moreCols>
- <xsl:apply-templates select="tab/dimension_line" mode="meta"/>
- <ccs:measure>
- <xsl:value-of select="tab/crosstab/measure/@name"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="tab/crosstab/measure/@type"/>
- </ccs:measure>
- <ccs:measureStyle>measurecell</ccs:measureStyle>
- <xsl:apply-templates select="tab/crosstab/rows/row" mode="meta"/>
- <xsl:apply-templates select="tab/crosstab/columns/column" mode="meta"/>
- </ccs:table>
- </ccs:content>
- </ccs:bodyElements>
- <ccs:footerElements>
- <xsl:choose>
- <xsl:when test="normalize-space(tab/status_line/@status)">
- <ccs:id>3</ccs:id>
- <ccs:name>statusLine</ccs:name>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:hSize>0</ccs:hSize>
- <ccs:vSize>0</ccs:vSize>
- </ccs:textFrame>
- </ccs:content>
- </xsl:when>
- </xsl:choose>
- </ccs:footerElements>
- </ccs:page>
- </ccs:content>
- </ccs:pages>
- </xsl:template>
- <!-- get meta data about the rows or columns, will recurse to get nested rows or columns-->
- <xsl:template match="row" mode="meta">
- <ccs:rows>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:choose>
- <xsl:when test="@axis_pos">
- <xsl:value-of select="@axis_pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyleMeta"/>
- <xsl:apply-templates mode="contained-meta" select="row"/>
- </ccs:rows>
- </xsl:template>
- <xsl:template match="column" mode="meta">
- <ccs:columns>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:choose>
- <xsl:when test="@axis_pos">
- <xsl:value-of select="@axis_pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyleMeta"/>
- <xsl:apply-templates mode="contained-meta" select="column"/>
- </ccs:columns>
- </xsl:template>
- <xsl:template mode="contained-meta" match="column|row">
- <ccs:containedGroup>
- <ccs:isSummary>
- <xsl:choose>
- <xsl:when test="@summary">
- <xsl:value-of select="@summary"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </ccs:isSummary>
- <ccs:startPos>
- <xsl:choose>
- <xsl:when test="@axis_pos">
- <xsl:value-of select="@axis_pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:startPos>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:dimensionIndex>
- <xsl:value-of select="@dimIdx"/>
- </ccs:dimensionIndex>
- <ccs:size>0</ccs:size>
- <xsl:call-template name="labelStyleMeta"/>
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:apply-templates mode="contained-meta" select="row"/>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:apply-templates mode="contained-meta" select="column"/>
- </xsl:when>
- </xsl:choose>
- </ccs:containedGroup>
- <ccs:columnType>
- <ccs:id/>
- <ccs:style/>
- <ccs:name/>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:hSize>0</ccs:hSize>
- <ccs:vSize>0</ccs:vSize>
- </ccs:textFrame>
- </ccs:content>
- </ccs:columnType>
- </xsl:template>
- <!-- apply the class for the header -->
- <xsl:template name="labelStyleMeta">
- <ccs:style>
- <xsl:choose>
- <xsl:when test="@suppressed">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">8020rowlabelnested</xsl:when>
- <xsl:otherwise>8020rowlabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">8020labelcolnested</xsl:when>
- <xsl:otherwise>8020collabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@calculation">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">calculationrowlabelnested</xsl:when>
- <xsl:otherwise>calculationrowlabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">calculationcollabelnested</xsl:when>
- <xsl:otherwise>calculationcollabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@summary">
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summaryrowlabelone</xsl:when>
- <xsl:otherwise>summaryrowlabeltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycollabelone</xsl:when>
- <xsl:otherwise>summarycollabeltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="local-name() = 'row'">
- <xsl:choose>
- <xsl:when test="parent::row">rowLabelNested</xsl:when>
- <xsl:otherwise>rowLabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="local-name() = 'column'">
- <xsl:choose>
- <xsl:when test="parent::column">colLabelNested</xsl:when>
- <xsl:otherwise>colLabel</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:style>
- </xsl:template>
- <!-- get the data rows -->
- <xsl:template match="datarow" mode="meta">
- <ccs:row>
- <ccs:type>Detail</ccs:type>
- <xsl:for-each select="col">
- <ccs:cells>
- <ccs:id/>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:value>
- <xsl:value-of select="."/>
- </ccs:value>
- <ccs:dataFormat>
- <xsl:value-of select="@format"/>
- </ccs:dataFormat>
- </ccs:textFrame>
- </ccs:content>
- <xsl:call-template name="cellStyleMeta"/>
- </ccs:cells>
- </xsl:for-each>
- </ccs:row>
- </xsl:template>
- <!-- apply the class for the data cells -->
- <xsl:template name="cellStyleMeta">
- <ccs:style>
- <xsl:choose>
- <xsl:when test="@lowexception">lowexceptioncell</xsl:when>
- <xsl:when test="@highexception">highexceptioncell</xsl:when>
- <xsl:when test="@summary">
- <xsl:choose>
- <xsl:when test="@rank">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycellonerank</xsl:when>
- <xsl:otherwise>summarycelltworank</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@suppressed or @calculation">
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycelloneitalic</xsl:when>
- <xsl:otherwise>summarycelltwoitalic</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@summ_style_one">summarycellone</xsl:when>
- <xsl:otherwise>summarycelltwo</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@rank">rankcell</xsl:when>
- <xsl:when test="@calculation">calculationcell</xsl:when>
- <xsl:when test="@suppressed">8020cell</xsl:when>
- <xsl:otherwise>cell</xsl:otherwise>
- </xsl:choose>
- </ccs:style>
- </xsl:template>
- <!-- Tokenize the dimension line -->
- <xsl:template match="dimension_line" mode="meta">
- <xsl:call-template name="dimensionsMeta">
- <xsl:with-param name="dimStr" select="@details"/>
- </xsl:call-template>
- <ccs:style>dimLine</ccs:style>
- </xsl:template>
- <xsl:template name="dimensionsMeta">
- <xsl:param name="dimStr"/>
- <xsl:variable name="nextDim">
- <xsl:choose>
- <xsl:when test="starts-with($dimStr,'[')">
- <xsl:value-of select="substring-before(substring-after($dimStr,'['),']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$dimStr"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="otherDims">
- <xsl:if test="contains($dimStr,'[')">
- <xsl:value-of select="substring-after($dimStr,']')"/>
- </xsl:if>
- </xsl:variable>
- <ccs:dimensions>
- <xsl:value-of select="$nextDim"/>
- </ccs:dimensions>
- <xsl:if test="string-length($otherDims) != 0">
- <xsl:call-template name="dimensionsMeta">
- <xsl:with-param name="dimStr" select="$otherDims"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
|