123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769 |
- <?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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:ccs="http://developer.cognos.com/rds/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
- <xsl:param name="dataFmt">rawData</xsl:param>
- <xsl:template match="/">
- <ccs:reportData>
- <!-- The root object may or may not exist-->
- <xsl:for-each select="root/Document/DATA/PAGE">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- <xsl:for-each select="Document/DATA/PAGE">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- <!-- SFJ: include drill data -->
- <xsl:for-each select="root/Document/DRILLS">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- <xsl:for-each select="Document/DRILLS">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </ccs:reportData>
- </xsl:template>
- <xsl:template match="LIST">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:if test="@layoutClass = 'list' ">
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:locid>
- <xsl:value-of select="$locid"/>
- </ccs:locid>
- <ccs:style/>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:type>Table</ccs:type>
- <ccs:content>
- <ccs:table>
- <xsl:apply-templates select="DR"/>
- </ccs:table>
- </ccs:content>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@layoutClass = 'crosstab' ">
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:locid>
- <xsl:value-of select="$locid"/>
- </ccs:locid>
- <ccs:style/>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:type>Table</ccs:type>
- <ccs:content>
- <ccs:table>
- <xsl:apply-templates select="DR"/>
- </ccs:table>
- </ccs:content>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@layoutClass = 'table' ">
- <!-- SFJ: layout tables -->
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:style/>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:type>Table</ccs:type>
- <ccs:content>
- <ccs:table>
- <ccs:isLayout>1</ccs:isLayout>
- <xsl:apply-templates select="OTR">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'T',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:call-template name="styles"/>
- </ccs:table>
- </ccs:content>
- </xsl:element>
- <!-- SFJ: take out for now
- <xsl:for-each select="DR/DRI/*[local-name() != 'OMAP']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'T',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:for-each select="OTR/DRI/*[local-name() != 'OMAP']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'T',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- -->
- </xsl:if>
- <xsl:if test="@layoutClass = 'repeaterTable'">
- <xsl:for-each select="UNKNOWN/DRI">
- <xsl:call-template name="repeaterRow">
- <xsl:with-param name="locid">
- <xsl:value-of select="$locid"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- <!--
- <xsl:for-each select="UNKNOWN/DRI/*[local-name() != 'OMAP']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'RT',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- -->
- </xsl:if>
- </xsl:template>
- <xsl:template name="repeaterRow">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:for-each select="./*[local-name() != 'OMAP']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'RT',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <!-- Just in case the UNKNOWN element reappears again.
- <xsl:template match="UNKNOWN[@layoutClass='table']">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:for-each select="OTR/DRI/*">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'T',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- -->
- <xsl:template match="OFLDSET">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:for-each select="*[local-name() != 'OCAPTION']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'P',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="FORM|OTD">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:if test="@layoutClass = 'block' ">
- <xsl:for-each select="./*[local-name() != 'OMAP']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,'P',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="@layoutClass = 'pageHeader' ">
- <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
- <!-- <xsl:for-each select="LIST[@layoutClass='table']/DR/DRI/*[local-name() != 'OMAP'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OIMG | FORM |LIST[@layoutClass='table']/OTR/DRI/*[local-name() != 'OMAP']|OCHART|OFLDSET"> -->
- <xsl:for-each select="LIST[@layoutClass='table'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OHTML | OIMG | FORM | OCHART | OFLDSET | OMAP[@layoutClass='chart_map']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,':H',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">ccs:headerElements</xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="@layoutClass = 'pageBody'">
- <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
- <!-- <xsl:for-each select="LIST[@layoutClass='table']/DR/DRI/*[local-name() != 'OMAP'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OIMG | FORM |LIST[@layoutClass='table']/OTR/DRI/*[local-name() != 'OMAP']|OCHART|OFLDSET"> -->
- <xsl:for-each select="LIST[@layoutClass='table'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OHTML | OIMG | FORM | OCHART | OFLDSET | OMAP[@layoutClass='chart_map']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,':B',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">ccs:bodyElements</xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="@layoutClass = 'pageFooter'">
- <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
- <!-- <xsl:for-each select="LIST[@layoutClass='table']/DR/DRI/*[local-name() != 'OMAP'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OIMG | FORM |LIST[@layoutClass='table']/OTR/DRI/*[local-name() != 'OMAP']|OCHART|OFLDSET"> -->
- <xsl:for-each select="LIST[@layoutClass='table'] | LIST[@layoutClass='list'] | LIST[@layoutClass='repeaterTable'] | LIST[@layoutClass='crosstab'] | OTI | OHTML | OIMG | FORM | OCHART | OFLDSET | OMAP[@layoutClass='chart_map']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="concat($locid,':F',position())"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">ccs:footerElements</xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template match="PAGE">
- <xsl:variable name="locid">
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('page_',position())"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <ccs:pages>
- <ccs:id>
- <xsl:value-of select="$locid"/>
- </ccs:id>
- <ccs:name>
- <xsl:if test="@name">
- <xsl:value-of select="$locid"/>
- </xsl:if>
- </ccs:name>
- <ccs:type>Page</ccs:type>
- <ccs:content>
- <ccs:page>
- <xsl:apply-templates>
- <xsl:with-param name="locid">
- <xsl:value-of select="$locid"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </ccs:page>
- </ccs:content>
- <xsl:if test="../../styleOptions/cssUrl">
- <ccs:unprocessedStyle>
- <xsl:value-of select="../../styleOptions/cssUrl"/>
- </ccs:unprocessedStyle>
- </xsl:if>
- </ccs:pages>
- </xsl:template>
- <xsl:template match="DR">
- <ccs:row>
- <xsl:variable name="isCrosstabHeader">
- <xsl:choose>
- <xsl:when test="@layoutClass = 'crosstabColumns'">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <ccs:type>
- <xsl:variable name="rowtype">
- <xsl:value-of select="@type"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$isCrosstabHeader = '1'">Header</xsl:when>
- <xsl:when test="$rowtype = 'header'">Header</xsl:when>
- <xsl:when test="$rowtype = 'footer'">Footer</xsl:when>
- <xsl:otherwise>Detail</xsl:otherwise>
- </xsl:choose>
- </ccs:type>
- <xsl:for-each select="DRI">
- <ccs:cells>
- <!-- SFJ: my test for list/crosstab titles -->
- <xsl:variable name="isTitle">
- <xsl:choose>
- <xsl:when test="@type = 'columnTitle'">1</xsl:when>
- <xsl:when test="@layoutClass = 'listColumnTitle'">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <ccs:type>
- <xsl:choose>
- <xsl:when test="$isTitle = '1'">Title</xsl:when>
- <xsl:otherwise>Value</xsl:otherwise>
- </xsl:choose>
- </ccs:type>
- <!-- for an empty crosstab corner, create a textframe, with the spans and styles of the corner -->
- <xsl:if test="@layoutClass = 'crosstabCorner' and count(*) = 0">
- <ccs:parts>
- <ccs:id/>
- <xsl:if test="@rowspan">
- <ccs:rowspan>
- <xsl:value-of select="@rowspan"/>
- </ccs:rowspan>
- </xsl:if>
- <xsl:if test="@colspan">
- <ccs:colspan>
- <xsl:value-of select="@colspan"/>
- </ccs:colspan>
- </xsl:if>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <ccs:value/>
- <ccs:dataFormat/>
- <ccs:valueType>text</ccs:valueType>
- </ccs:textFrame>
- </ccs:content>
- <xsl:call-template name="styles"/>
- </ccs:parts>
- </xsl:if>
- <xsl:for-each select="*">
- <xsl:apply-templates select=".">
- <xsl:with-param name="reloc">ccs:parts</xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </ccs:cells>
- </xsl:for-each>
- </ccs:row>
- </xsl:template>
- <xsl:template match="OIMG ">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <!-- temp fix for handling QS sort indicator images in COC -->
- <xsl:if test="$reloc != 'parts' or count(../*) < 2">
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:locid>
- <xsl:value-of select="$locid"/>
- </ccs:locid>
- <ccs:type>Image</ccs:type>
- <ccs:content>
- <ccs:image>
- <ccs:url>
- <xsl:choose>
- <xsl:when test="starts-with(@src,'http')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:when test="starts-with(@src,'file')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <ccs:unprocessedGateway>
- <xsl:choose>
- <xsl:when test="starts-with(@src,'?')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('/../', @src)"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:unprocessedGateway>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:url>
- </ccs:image>
- <ccs:style/>
- </ccs:content>
- </xsl:element>
- </xsl:if>
- <xsl:call-template name="styles"/>
- </xsl:template>
- <!-- SFJ: chart map support -->
- <xsl:template match="OMAP">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:element name="{$reloc}">
- <ccs:type>Map</ccs:type>
- <ccs:content>
- <ccs:map>
- <ccs:id>
- <xsl:value-of select="@name"/>
- </ccs:id>
- <xsl:for-each select="OAREA">
- <!--support MAP based Drill-Through-->
- <xsl:if test="@title | drillTargets">
- <ccs:area>
- <xsl:if test="drillTargets">
- <xsl:for-each select="drillTargets/drillTarget">
- <ccs:drillTarget>
- <ccs:drillIndex>
- <xsl:value-of select="@drillIdx"/>
- </ccs:drillIndex>
- <xsl:for-each select="drillParameter">
- <ccs:drillParameter>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:value>
- <xsl:value-of select="@value"/>
- </ccs:value>
- </ccs:drillParameter>
- </xsl:for-each>
- </ccs:drillTarget>
- </xsl:for-each>
- </xsl:if>
- <ccs:label>
- <xsl:value-of select="@title"/>
- </ccs:label>
- <xsl:if test="@shape='POLY'">
- <ccs:poly>
- <xsl:value-of select="@coords"/>
- </ccs:poly>
- </xsl:if>
- </ccs:area>
- </xsl:if>
- </xsl:for-each>
- </ccs:map>
- </ccs:content>
- </xsl:element>
- </xsl:template>
- <xsl:template match="OCHART">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:locid>
- <xsl:value-of select="$locid"/>
- </ccs:locid>
- <ccs:type>Chart</ccs:type>
- <ccs:content>
- <ccs:chart>
- <ccs:imageUrl>
- <xsl:choose>
- <xsl:when test="starts-with(@src,'http')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:when test="starts-with(@src,'file')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <ccs:unprocessedGateway>
- <xsl:choose>
- <xsl:when test="starts-with(@src,'?')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('/../', @src)"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:unprocessedGateway>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:imageUrl>
- <!-- SFJ: the size and map of this chart -->
- <ccs:imageWidth>
- <xsl:value-of select="@chart_width"/>
- </ccs:imageWidth>
- <ccs:imageHeight>
- <xsl:value-of select="@chart_height"/>
- </ccs:imageHeight>
- <ccs:imageMap>
- <xsl:value-of select="@usemap"/>
- </ccs:imageMap>
- </ccs:chart>
- <ccs:style/>
- </ccs:content>
- </xsl:element>
- </xsl:template>
- <xsl:template match="OTR">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:choose>
- <!-- generate a layout table row if we have cells -->
- <xsl:when test="DRI[@layoutClass='tableCell']">
- <ccs:row>
- <!-- generate a ccs:parts element for each table cell -->
- <xsl:for-each select="DRI[@layoutClass='tableCell']">
- <ccs:cells>
- <ccs:id/>
- <xsl:if test="@rowspan">
- <ccs:rowspan>
- <xsl:value-of select="@rowspan"/>
- </ccs:rowspan>
- </xsl:if>
- <xsl:if test="@colspan">
- <ccs:colspan>
- <xsl:value-of select="@colspan"/>
- </ccs:colspan>
- </xsl:if>
- <xsl:for-each select="*">
- <xsl:apply-templates select=".">
- <xsl:with-param name="reloc">ccs:parts</xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </ccs:cells>
- </xsl:for-each>
- <xsl:call-template name="styles"/>
- </ccs:row>
- </xsl:when>
- <xsl:otherwise>
- <!-- not a layout table, so proceed as before... -->
- <xsl:for-each select="*">
- <xsl:apply-templates select=".">
- <xsl:with-param name="locid">
- <xsl:value-of select="$locid"/>
- </xsl:with-param>
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="drillTargets">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:for-each select="OTI | OHTML">
- <xsl:apply-templates select=".">
- <xsl:with-param name="reloc">
- <xsl:value-of select="$reloc"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="OCAPTION">
- <!-- Do nothing with fieldset captions-->
- </xsl:template>
- <xsl:template match="OTI | OHTML">
- <xsl:param name="locid"/>
- <xsl:param name="reloc"/>
- <xsl:if test="not(@style = 'visibility:hidden')">
- <xsl:element name="{$reloc}">
- <ccs:id>
- <xsl:choose>
- <xsl:when test="@name">
- <xsl:value-of select="@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$locid"/>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:id>
- <ccs:locid>
- <xsl:value-of select="$locid"/>
- </ccs:locid>
- <xsl:choose>
- <xsl:when test="../../drillTargets">
- <xsl:if test="../../@rowspan">
- <ccs:rowspan>
- <xsl:value-of select="../../@rowspan"/>
- </ccs:rowspan>
- </xsl:if>
- </xsl:when>
- <xsl:when test="../../../../@rowspan and ../../../@layoutClass='table'">
- <ccs:rowspan>
- <xsl:value-of select="../../../../@rowspan"/>
- </ccs:rowspan>
- </xsl:when>
- <xsl:when test="../@rowspan">
- <ccs:rowspan>
- <xsl:value-of select="../@rowspan"/>
- </ccs:rowspan>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="../../drillTargets">
- <xsl:choose>
- <xsl:when test="../../@colspan">
- <ccs:colspan>
- <xsl:value-of select="../../@colspan"/>
- </ccs:colspan>
- </xsl:when>
- <xsl:when test="../../@colSpan">
- <ccs:colspan>
- <xsl:value-of select="../../@colSpan"/>
- </ccs:colspan>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="../../../../@colspan and ../../../@layoutClass='table'">
- <ccs:colspan>
- <xsl:value-of select="../../../../@colspan"/>
- </ccs:colspan>
- </xsl:when>
- <xsl:when test="../@colspan">
- <ccs:colspan>
- <xsl:value-of select="../@colspan"/>
- </ccs:colspan>
- </xsl:when>
- <xsl:when test="../@colSpan">
- <colspan>
- <xsl:value-of select="../@colSpan"/>
- </colspan>
- </xsl:when>
- </xsl:choose>
- <ccs:type>TextFrame</ccs:type>
- <ccs:content>
- <ccs:textFrame>
- <!-- SFJ: add the drill information -->
- <xsl:if test="../../drillTargets">
- <xsl:for-each select="../../drillTargets/drillTarget">
- <ccs:drillTarget>
- <ccs:drillIndex>
- <xsl:value-of select="@drillIdx"/>
- </ccs:drillIndex>
- <xsl:for-each select="drillParameter">
- <ccs:drillParameter>
- <ccs:name>
- <xsl:value-of select="@name"/>
- </ccs:name>
- <ccs:value>
- <xsl:value-of select="@value"/>
- </ccs:value>
- </ccs:drillParameter>
- </xsl:for-each>
- </ccs:drillTarget>
- </xsl:for-each>
- </xsl:if>
- <ccs:value>
- <xsl:choose>
- <xsl:when test="($dataFmt='formattedData') or (string-length(@RawXML) = 0 )">
- <xsl:value-of select="."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@valueType = 'number' ">
- <xsl:value-of select="translate(@RawXML, ',', '.')"/>
- </xsl:when>
- <xsl:when test="@valueType = 'currency' ">
- <xsl:value-of select="translate(@RawXML, ',', '.')"/>
- </xsl:when>
- <xsl:when test="@valueType = 'percent' ">
- <xsl:value-of select="translate(@RawXML, ',', '.')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@RawXML"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </ccs:value>
- <ccs:dataFormat>
- <xsl:value-of select="@formatPatternExcel"/>
- </ccs:dataFormat>
- <ccs:valueType>
- <xsl:value-of select="@valueType"/>
- </ccs:valueType>
- </ccs:textFrame>
- </ccs:content>
- <xsl:call-template name="styles"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="styles">
- <xsl:if test="string-length(../../../@class) > 0">
- <ccs:preProcessedStyle>
- <xsl:value-of select="../../../@class"/>
- </ccs:preProcessedStyle>
- </xsl:if>
- <xsl:if test="string-length(../../../@style) > 0">
- <ccs:unprocessedStyle>
- <xsl:value-of select="../../../@style"/>
- </ccs:unprocessedStyle>
- </xsl:if>
- <xsl:if test="string-length(../../@class) > 0">
- <ccs:preProcessedStyle>
- <xsl:value-of select="../../@class"/>
- </ccs:preProcessedStyle>
- </xsl:if>
- <xsl:if test="string-length(../../@style) > 0">
- <ccs:unprocessedStyle>
- <xsl:value-of select="../../@style"/>
- </ccs:unprocessedStyle>
- </xsl:if>
- <xsl:if test="string-length(../@class) > 0">
- <ccs:preProcessedStyle>
- <xsl:value-of select="../@class"/>
- </ccs:preProcessedStyle>
- </xsl:if>
- <xsl:if test="string-length(../@style) > 0">
- <ccs:unprocessedStyle>
- <xsl:value-of select="../@style"/>
- </ccs:unprocessedStyle>
- </xsl:if>
- <xsl:if test="string-length(@class) > 0">
- <ccs:preProcessedStyle>
- <xsl:value-of select="@class"/>
- </ccs:preProcessedStyle>
- </xsl:if>
- <xsl:if test="string-length(@style) > 0">
- <ccs:unprocessedStyle>
- <xsl:value-of select="@style"/>
- </ccs:unprocessedStyle>
- </xsl:if>
- </xsl:template>
- <!-- SFJ: drill-through support -->
- <xsl:template match="DRILL">
- <ccs:drill>
- <ccs:cmPath>
- <xsl:value-of select="@path"/>
- </ccs:cmPath>
- <ccs:label>
- <xsl:value-of select="@label"/>
- </ccs:label>
- <xsl:copy-of select="*"/>
- </ccs:drill>
- </xsl:template>
- </xsl:stylesheet>
|