rds_mobile_data.xsl 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: CCS
  5. (c) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <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/">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:param name="dataFmt">rawData</xsl:param>
  11. <xsl:template match="/">
  12. <ccs:reportData>
  13. <!-- The root object may or may not exist-->
  14. <xsl:for-each select="root/Document/DATA/PAGE">
  15. <xsl:apply-templates select="."/>
  16. </xsl:for-each>
  17. <xsl:for-each select="Document/DATA/PAGE">
  18. <xsl:apply-templates select="."/>
  19. </xsl:for-each>
  20. <!-- SFJ: include drill data -->
  21. <xsl:for-each select="root/Document/DRILLS">
  22. <xsl:apply-templates select="."/>
  23. </xsl:for-each>
  24. <xsl:for-each select="Document/DRILLS">
  25. <xsl:apply-templates select="."/>
  26. </xsl:for-each>
  27. </ccs:reportData>
  28. </xsl:template>
  29. <xsl:template match="LIST">
  30. <xsl:param name="locid"/>
  31. <xsl:param name="reloc"/>
  32. <xsl:if test="@layoutClass = 'list' ">
  33. <xsl:element name="{$reloc}">
  34. <ccs:id>
  35. <xsl:choose>
  36. <xsl:when test="@name">
  37. <xsl:value-of select="@name"/>
  38. </xsl:when>
  39. <xsl:otherwise>
  40. <xsl:value-of select="$locid"/>
  41. </xsl:otherwise>
  42. </xsl:choose>
  43. </ccs:id>
  44. <ccs:locid>
  45. <xsl:value-of select="$locid"/>
  46. </ccs:locid>
  47. <ccs:style/>
  48. <ccs:name>
  49. <xsl:value-of select="@name"/>
  50. </ccs:name>
  51. <ccs:type>Table</ccs:type>
  52. <ccs:content>
  53. <ccs:table>
  54. <xsl:apply-templates select="DR"/>
  55. </ccs:table>
  56. </ccs:content>
  57. </xsl:element>
  58. </xsl:if>
  59. <xsl:if test="@layoutClass = 'crosstab' ">
  60. <xsl:element name="{$reloc}">
  61. <ccs:id>
  62. <xsl:choose>
  63. <xsl:when test="@name">
  64. <xsl:value-of select="@name"/>
  65. </xsl:when>
  66. <xsl:otherwise>
  67. <xsl:value-of select="$locid"/>
  68. </xsl:otherwise>
  69. </xsl:choose>
  70. </ccs:id>
  71. <ccs:locid>
  72. <xsl:value-of select="$locid"/>
  73. </ccs:locid>
  74. <ccs:style/>
  75. <ccs:name>
  76. <xsl:value-of select="@name"/>
  77. </ccs:name>
  78. <ccs:type>Table</ccs:type>
  79. <ccs:content>
  80. <ccs:table>
  81. <xsl:apply-templates select="DR"/>
  82. </ccs:table>
  83. </ccs:content>
  84. </xsl:element>
  85. </xsl:if>
  86. <xsl:if test="@layoutClass = 'table' ">
  87. <!-- SFJ: layout tables -->
  88. <xsl:element name="{$reloc}">
  89. <ccs:id>
  90. <xsl:choose>
  91. <xsl:when test="@name">
  92. <xsl:value-of select="@name"/>
  93. </xsl:when>
  94. <xsl:otherwise>
  95. <xsl:value-of select="$locid"/>
  96. </xsl:otherwise>
  97. </xsl:choose>
  98. </ccs:id>
  99. <ccs:style/>
  100. <ccs:name>
  101. <xsl:value-of select="@name"/>
  102. </ccs:name>
  103. <ccs:type>Table</ccs:type>
  104. <ccs:content>
  105. <ccs:table>
  106. <ccs:isLayout>1</ccs:isLayout>
  107. <xsl:apply-templates select="OTR">
  108. <xsl:with-param name="locid">
  109. <xsl:value-of select="concat($locid,'T',position())"/>
  110. </xsl:with-param>
  111. <xsl:with-param name="reloc">
  112. <xsl:value-of select="$reloc"/>
  113. </xsl:with-param>
  114. </xsl:apply-templates>
  115. <xsl:call-template name="styles"/>
  116. </ccs:table>
  117. </ccs:content>
  118. </xsl:element>
  119. <!-- SFJ: take out for now
  120. <xsl:for-each select="DR/DRI/*[local-name() != 'OMAP']">
  121. <xsl:apply-templates select=".">
  122. <xsl:with-param name="locid">
  123. <xsl:value-of select="concat($locid,'T',position())"/>
  124. </xsl:with-param>
  125. <xsl:with-param name="reloc">
  126. <xsl:value-of select="$reloc"/>
  127. </xsl:with-param>
  128. </xsl:apply-templates>
  129. </xsl:for-each>
  130. <xsl:for-each select="OTR/DRI/*[local-name() != 'OMAP']">
  131. <xsl:apply-templates select=".">
  132. <xsl:with-param name="locid">
  133. <xsl:value-of select="concat($locid,'T',position())"/>
  134. </xsl:with-param>
  135. <xsl:with-param name="reloc">
  136. <xsl:value-of select="$reloc"/>
  137. </xsl:with-param>
  138. </xsl:apply-templates>
  139. </xsl:for-each>
  140. -->
  141. </xsl:if>
  142. <xsl:if test="@layoutClass = 'repeaterTable'">
  143. <xsl:for-each select="UNKNOWN/DRI">
  144. <xsl:call-template name="repeaterRow">
  145. <xsl:with-param name="locid">
  146. <xsl:value-of select="$locid"/>
  147. </xsl:with-param>
  148. <xsl:with-param name="reloc">
  149. <xsl:value-of select="$reloc"/>
  150. </xsl:with-param>
  151. </xsl:call-template>
  152. </xsl:for-each>
  153. <!--
  154. <xsl:for-each select="UNKNOWN/DRI/*[local-name() != 'OMAP']">
  155. <xsl:apply-templates select=".">
  156. <xsl:with-param name="locid">
  157. <xsl:value-of select="concat($locid,'RT',position())"/>
  158. </xsl:with-param>
  159. <xsl:with-param name="reloc">
  160. <xsl:value-of select="$reloc"/>
  161. </xsl:with-param>
  162. </xsl:apply-templates>
  163. </xsl:for-each>
  164. -->
  165. </xsl:if>
  166. </xsl:template>
  167. <xsl:template name="repeaterRow">
  168. <xsl:param name="locid"/>
  169. <xsl:param name="reloc"/>
  170. <xsl:for-each select="./*[local-name() != 'OMAP']">
  171. <xsl:apply-templates select=".">
  172. <xsl:with-param name="locid">
  173. <xsl:value-of select="concat($locid,'RT',position())"/>
  174. </xsl:with-param>
  175. <xsl:with-param name="reloc">
  176. <xsl:value-of select="$reloc"/>
  177. </xsl:with-param>
  178. </xsl:apply-templates>
  179. </xsl:for-each>
  180. </xsl:template>
  181. <!-- Just in case the UNKNOWN element reappears again.
  182. <xsl:template match="UNKNOWN[@layoutClass='table']">
  183. <xsl:param name="locid"/>
  184. <xsl:param name="reloc"/>
  185. <xsl:for-each select="OTR/DRI/*">
  186. <xsl:apply-templates select=".">
  187. <xsl:with-param name="locid">
  188. <xsl:value-of select="concat($locid,'T',position())"/>
  189. </xsl:with-param>
  190. <xsl:with-param name="reloc">
  191. <xsl:value-of select="$reloc"/>
  192. </xsl:with-param>
  193. </xsl:apply-templates>
  194. </xsl:for-each>
  195. </xsl:template>
  196. -->
  197. <xsl:template match="OFLDSET">
  198. <xsl:param name="locid"/>
  199. <xsl:param name="reloc"/>
  200. <xsl:for-each select="*[local-name() != 'OCAPTION']">
  201. <xsl:apply-templates select=".">
  202. <xsl:with-param name="locid">
  203. <xsl:value-of select="concat($locid,'P',position())"/>
  204. </xsl:with-param>
  205. <xsl:with-param name="reloc">
  206. <xsl:value-of select="$reloc"/>
  207. </xsl:with-param>
  208. </xsl:apply-templates>
  209. </xsl:for-each>
  210. </xsl:template>
  211. <xsl:template match="FORM|OTD">
  212. <xsl:param name="locid"/>
  213. <xsl:param name="reloc"/>
  214. <xsl:if test="@layoutClass = 'block' ">
  215. <xsl:for-each select="./*[local-name() != 'OMAP']">
  216. <xsl:apply-templates select=".">
  217. <xsl:with-param name="locid">
  218. <xsl:value-of select="concat($locid,'P',position())"/>
  219. </xsl:with-param>
  220. <xsl:with-param name="reloc">
  221. <xsl:value-of select="$reloc"/>
  222. </xsl:with-param>
  223. </xsl:apply-templates>
  224. </xsl:for-each>
  225. </xsl:if>
  226. <xsl:if test="@layoutClass = 'pageHeader' ">
  227. <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
  228. <!-- <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"> -->
  229. <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']">
  230. <xsl:apply-templates select=".">
  231. <xsl:with-param name="locid">
  232. <xsl:value-of select="concat($locid,':H',position())"/>
  233. </xsl:with-param>
  234. <xsl:with-param name="reloc">ccs:headerElements</xsl:with-param>
  235. </xsl:apply-templates>
  236. </xsl:for-each>
  237. </xsl:if>
  238. <xsl:if test="@layoutClass = 'pageBody'">
  239. <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
  240. <!-- <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"> -->
  241. <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']">
  242. <xsl:apply-templates select=".">
  243. <xsl:with-param name="locid">
  244. <xsl:value-of select="concat($locid,':B',position())"/>
  245. </xsl:with-param>
  246. <xsl:with-param name="reloc">ccs:bodyElements</xsl:with-param>
  247. </xsl:apply-templates>
  248. </xsl:for-each>
  249. </xsl:if>
  250. <xsl:if test="@layoutClass = 'pageFooter'">
  251. <!-- SFJ: no longer explicitly skip over layout table children, and added maps -->
  252. <!-- <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"> -->
  253. <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']">
  254. <xsl:apply-templates select=".">
  255. <xsl:with-param name="locid">
  256. <xsl:value-of select="concat($locid,':F',position())"/>
  257. </xsl:with-param>
  258. <xsl:with-param name="reloc">ccs:footerElements</xsl:with-param>
  259. </xsl:apply-templates>
  260. </xsl:for-each>
  261. </xsl:if>
  262. </xsl:template>
  263. <xsl:template match="PAGE">
  264. <xsl:variable name="locid">
  265. <xsl:choose>
  266. <xsl:when test="@name">
  267. <xsl:value-of select="@name"/>
  268. </xsl:when>
  269. <xsl:otherwise>
  270. <xsl:value-of select="concat('page_',position())"/>
  271. </xsl:otherwise>
  272. </xsl:choose>
  273. </xsl:variable>
  274. <ccs:pages>
  275. <ccs:id>
  276. <xsl:value-of select="$locid"/>
  277. </ccs:id>
  278. <ccs:name>
  279. <xsl:if test="@name">
  280. <xsl:value-of select="$locid"/>
  281. </xsl:if>
  282. </ccs:name>
  283. <ccs:type>Page</ccs:type>
  284. <ccs:content>
  285. <ccs:page>
  286. <xsl:apply-templates>
  287. <xsl:with-param name="locid">
  288. <xsl:value-of select="$locid"/>
  289. </xsl:with-param>
  290. </xsl:apply-templates>
  291. </ccs:page>
  292. </ccs:content>
  293. <xsl:if test="../../styleOptions/cssUrl">
  294. <ccs:unprocessedStyle>
  295. <xsl:value-of select="../../styleOptions/cssUrl"/>
  296. </ccs:unprocessedStyle>
  297. </xsl:if>
  298. </ccs:pages>
  299. </xsl:template>
  300. <xsl:template match="DR">
  301. <ccs:row>
  302. <xsl:variable name="isCrosstabHeader">
  303. <xsl:choose>
  304. <xsl:when test="@layoutClass = 'crosstabColumns'">1</xsl:when>
  305. <xsl:otherwise>0</xsl:otherwise>
  306. </xsl:choose>
  307. </xsl:variable>
  308. <ccs:type>
  309. <xsl:variable name="rowtype">
  310. <xsl:value-of select="@type"/>
  311. </xsl:variable>
  312. <xsl:choose>
  313. <xsl:when test="$isCrosstabHeader = '1'">Header</xsl:when>
  314. <xsl:when test="$rowtype = 'header'">Header</xsl:when>
  315. <xsl:when test="$rowtype = 'footer'">Footer</xsl:when>
  316. <xsl:otherwise>Detail</xsl:otherwise>
  317. </xsl:choose>
  318. </ccs:type>
  319. <xsl:for-each select="DRI">
  320. <ccs:cells>
  321. <!-- SFJ: my test for list/crosstab titles -->
  322. <xsl:variable name="isTitle">
  323. <xsl:choose>
  324. <xsl:when test="@type = 'columnTitle'">1</xsl:when>
  325. <xsl:when test="@layoutClass = 'listColumnTitle'">1</xsl:when>
  326. <xsl:otherwise>0</xsl:otherwise>
  327. </xsl:choose>
  328. </xsl:variable>
  329. <ccs:type>
  330. <xsl:choose>
  331. <xsl:when test="$isTitle = '1'">Title</xsl:when>
  332. <xsl:otherwise>Value</xsl:otherwise>
  333. </xsl:choose>
  334. </ccs:type>
  335. <!-- for an empty crosstab corner, create a textframe, with the spans and styles of the corner -->
  336. <xsl:if test="@layoutClass = 'crosstabCorner' and count(*) = 0">
  337. <ccs:parts>
  338. <ccs:id/>
  339. <xsl:if test="@rowspan">
  340. <ccs:rowspan>
  341. <xsl:value-of select="@rowspan"/>
  342. </ccs:rowspan>
  343. </xsl:if>
  344. <xsl:if test="@colspan">
  345. <ccs:colspan>
  346. <xsl:value-of select="@colspan"/>
  347. </ccs:colspan>
  348. </xsl:if>
  349. <ccs:type>TextFrame</ccs:type>
  350. <ccs:content>
  351. <ccs:textFrame>
  352. <ccs:value/>
  353. <ccs:dataFormat/>
  354. <ccs:valueType>text</ccs:valueType>
  355. </ccs:textFrame>
  356. </ccs:content>
  357. <xsl:call-template name="styles"/>
  358. </ccs:parts>
  359. </xsl:if>
  360. <xsl:for-each select="*">
  361. <xsl:apply-templates select=".">
  362. <xsl:with-param name="reloc">ccs:parts</xsl:with-param>
  363. </xsl:apply-templates>
  364. </xsl:for-each>
  365. </ccs:cells>
  366. </xsl:for-each>
  367. </ccs:row>
  368. </xsl:template>
  369. <xsl:template match="OIMG ">
  370. <xsl:param name="locid"/>
  371. <xsl:param name="reloc"/>
  372. <!-- temp fix for handling QS sort indicator images in COC -->
  373. <xsl:if test="$reloc != 'parts' or count(../*) &lt; 2">
  374. <xsl:element name="{$reloc}">
  375. <ccs:id>
  376. <xsl:choose>
  377. <xsl:when test="@name">
  378. <xsl:value-of select="@name"/>
  379. </xsl:when>
  380. <xsl:otherwise>
  381. <xsl:value-of select="$locid"/>
  382. </xsl:otherwise>
  383. </xsl:choose>
  384. </ccs:id>
  385. <ccs:locid>
  386. <xsl:value-of select="$locid"/>
  387. </ccs:locid>
  388. <ccs:type>Image</ccs:type>
  389. <ccs:content>
  390. <ccs:image>
  391. <ccs:url>
  392. <xsl:choose>
  393. <xsl:when test="starts-with(@src,'http')">
  394. <xsl:value-of select="@src"/>
  395. </xsl:when>
  396. <xsl:when test="starts-with(@src,'file')">
  397. <xsl:value-of select="@src"/>
  398. </xsl:when>
  399. <xsl:otherwise>
  400. <ccs:unprocessedGateway>
  401. <xsl:choose>
  402. <xsl:when test="starts-with(@src,'?')">
  403. <xsl:value-of select="@src"/>
  404. </xsl:when>
  405. <xsl:otherwise>
  406. <xsl:value-of select="concat('/../', @src)"/>
  407. </xsl:otherwise>
  408. </xsl:choose>
  409. </ccs:unprocessedGateway>
  410. </xsl:otherwise>
  411. </xsl:choose>
  412. </ccs:url>
  413. </ccs:image>
  414. <ccs:style/>
  415. </ccs:content>
  416. </xsl:element>
  417. </xsl:if>
  418. <xsl:call-template name="styles"/>
  419. </xsl:template>
  420. <!-- SFJ: chart map support -->
  421. <xsl:template match="OMAP">
  422. <xsl:param name="locid"/>
  423. <xsl:param name="reloc"/>
  424. <xsl:element name="{$reloc}">
  425. <ccs:type>Map</ccs:type>
  426. <ccs:content>
  427. <ccs:map>
  428. <ccs:id>
  429. <xsl:value-of select="@name"/>
  430. </ccs:id>
  431. <xsl:for-each select="OAREA">
  432. <!--support MAP based Drill-Through-->
  433. <xsl:if test="@title | drillTargets">
  434. <ccs:area>
  435. <xsl:if test="drillTargets">
  436. <xsl:for-each select="drillTargets/drillTarget">
  437. <ccs:drillTarget>
  438. <ccs:drillIndex>
  439. <xsl:value-of select="@drillIdx"/>
  440. </ccs:drillIndex>
  441. <xsl:for-each select="drillParameter">
  442. <ccs:drillParameter>
  443. <ccs:name>
  444. <xsl:value-of select="@name"/>
  445. </ccs:name>
  446. <ccs:value>
  447. <xsl:value-of select="@value"/>
  448. </ccs:value>
  449. </ccs:drillParameter>
  450. </xsl:for-each>
  451. </ccs:drillTarget>
  452. </xsl:for-each>
  453. </xsl:if>
  454. <ccs:label>
  455. <xsl:value-of select="@title"/>
  456. </ccs:label>
  457. <xsl:if test="@shape='POLY'">
  458. <ccs:poly>
  459. <xsl:value-of select="@coords"/>
  460. </ccs:poly>
  461. </xsl:if>
  462. </ccs:area>
  463. </xsl:if>
  464. </xsl:for-each>
  465. </ccs:map>
  466. </ccs:content>
  467. </xsl:element>
  468. </xsl:template>
  469. <xsl:template match="OCHART">
  470. <xsl:param name="locid"/>
  471. <xsl:param name="reloc"/>
  472. <xsl:element name="{$reloc}">
  473. <ccs:id>
  474. <xsl:choose>
  475. <xsl:when test="@name">
  476. <xsl:value-of select="@name"/>
  477. </xsl:when>
  478. <xsl:otherwise>
  479. <xsl:value-of select="$locid"/>
  480. </xsl:otherwise>
  481. </xsl:choose>
  482. </ccs:id>
  483. <ccs:locid>
  484. <xsl:value-of select="$locid"/>
  485. </ccs:locid>
  486. <ccs:type>Chart</ccs:type>
  487. <ccs:content>
  488. <ccs:chart>
  489. <ccs:imageUrl>
  490. <xsl:choose>
  491. <xsl:when test="starts-with(@src,'http')">
  492. <xsl:value-of select="@src"/>
  493. </xsl:when>
  494. <xsl:when test="starts-with(@src,'file')">
  495. <xsl:value-of select="@src"/>
  496. </xsl:when>
  497. <xsl:otherwise>
  498. <ccs:unprocessedGateway>
  499. <xsl:choose>
  500. <xsl:when test="starts-with(@src,'?')">
  501. <xsl:value-of select="@src"/>
  502. </xsl:when>
  503. <xsl:otherwise>
  504. <xsl:value-of select="concat('/../', @src)"/>
  505. </xsl:otherwise>
  506. </xsl:choose>
  507. </ccs:unprocessedGateway>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </ccs:imageUrl>
  511. <!-- SFJ: the size and map of this chart -->
  512. <ccs:imageWidth>
  513. <xsl:value-of select="@chart_width"/>
  514. </ccs:imageWidth>
  515. <ccs:imageHeight>
  516. <xsl:value-of select="@chart_height"/>
  517. </ccs:imageHeight>
  518. <ccs:imageMap>
  519. <xsl:value-of select="@usemap"/>
  520. </ccs:imageMap>
  521. </ccs:chart>
  522. <ccs:style/>
  523. </ccs:content>
  524. </xsl:element>
  525. </xsl:template>
  526. <xsl:template match="OTR">
  527. <xsl:param name="locid"/>
  528. <xsl:param name="reloc"/>
  529. <xsl:choose>
  530. <!-- generate a layout table row if we have cells -->
  531. <xsl:when test="DRI[@layoutClass='tableCell']">
  532. <ccs:row>
  533. <!-- generate a ccs:parts element for each table cell -->
  534. <xsl:for-each select="DRI[@layoutClass='tableCell']">
  535. <ccs:cells>
  536. <ccs:id/>
  537. <xsl:if test="@rowspan">
  538. <ccs:rowspan>
  539. <xsl:value-of select="@rowspan"/>
  540. </ccs:rowspan>
  541. </xsl:if>
  542. <xsl:if test="@colspan">
  543. <ccs:colspan>
  544. <xsl:value-of select="@colspan"/>
  545. </ccs:colspan>
  546. </xsl:if>
  547. <xsl:for-each select="*">
  548. <xsl:apply-templates select=".">
  549. <xsl:with-param name="reloc">ccs:parts</xsl:with-param>
  550. </xsl:apply-templates>
  551. </xsl:for-each>
  552. </ccs:cells>
  553. </xsl:for-each>
  554. <xsl:call-template name="styles"/>
  555. </ccs:row>
  556. </xsl:when>
  557. <xsl:otherwise>
  558. <!-- not a layout table, so proceed as before... -->
  559. <xsl:for-each select="*">
  560. <xsl:apply-templates select=".">
  561. <xsl:with-param name="locid">
  562. <xsl:value-of select="$locid"/>
  563. </xsl:with-param>
  564. <xsl:with-param name="reloc">
  565. <xsl:value-of select="$reloc"/>
  566. </xsl:with-param>
  567. </xsl:apply-templates>
  568. </xsl:for-each>
  569. </xsl:otherwise>
  570. </xsl:choose>
  571. </xsl:template>
  572. <xsl:template match="drillTargets">
  573. <xsl:param name="locid"/>
  574. <xsl:param name="reloc"/>
  575. <xsl:for-each select="OTI | OHTML">
  576. <xsl:apply-templates select=".">
  577. <xsl:with-param name="reloc">
  578. <xsl:value-of select="$reloc"/>
  579. </xsl:with-param>
  580. </xsl:apply-templates>
  581. </xsl:for-each>
  582. </xsl:template>
  583. <xsl:template match="OCAPTION">
  584. <!-- Do nothing with fieldset captions-->
  585. </xsl:template>
  586. <xsl:template match="OTI | OHTML">
  587. <xsl:param name="locid"/>
  588. <xsl:param name="reloc"/>
  589. <xsl:if test="not(@style = 'visibility:hidden')">
  590. <xsl:element name="{$reloc}">
  591. <ccs:id>
  592. <xsl:choose>
  593. <xsl:when test="@name">
  594. <xsl:value-of select="@name"/>
  595. </xsl:when>
  596. <xsl:otherwise>
  597. <xsl:value-of select="$locid"/>
  598. </xsl:otherwise>
  599. </xsl:choose>
  600. </ccs:id>
  601. <ccs:locid>
  602. <xsl:value-of select="$locid"/>
  603. </ccs:locid>
  604. <xsl:choose>
  605. <xsl:when test="../../drillTargets">
  606. <xsl:if test="../../@rowspan">
  607. <ccs:rowspan>
  608. <xsl:value-of select="../../@rowspan"/>
  609. </ccs:rowspan>
  610. </xsl:if>
  611. </xsl:when>
  612. <xsl:when test="../../../../@rowspan and ../../../@layoutClass='table'">
  613. <ccs:rowspan>
  614. <xsl:value-of select="../../../../@rowspan"/>
  615. </ccs:rowspan>
  616. </xsl:when>
  617. <xsl:when test="../@rowspan">
  618. <ccs:rowspan>
  619. <xsl:value-of select="../@rowspan"/>
  620. </ccs:rowspan>
  621. </xsl:when>
  622. </xsl:choose>
  623. <xsl:choose>
  624. <xsl:when test="../../drillTargets">
  625. <xsl:choose>
  626. <xsl:when test="../../@colspan">
  627. <ccs:colspan>
  628. <xsl:value-of select="../../@colspan"/>
  629. </ccs:colspan>
  630. </xsl:when>
  631. <xsl:when test="../../@colSpan">
  632. <ccs:colspan>
  633. <xsl:value-of select="../../@colSpan"/>
  634. </ccs:colspan>
  635. </xsl:when>
  636. </xsl:choose>
  637. </xsl:when>
  638. <xsl:when test="../../../../@colspan and ../../../@layoutClass='table'">
  639. <ccs:colspan>
  640. <xsl:value-of select="../../../../@colspan"/>
  641. </ccs:colspan>
  642. </xsl:when>
  643. <xsl:when test="../@colspan">
  644. <ccs:colspan>
  645. <xsl:value-of select="../@colspan"/>
  646. </ccs:colspan>
  647. </xsl:when>
  648. <xsl:when test="../@colSpan">
  649. <colspan>
  650. <xsl:value-of select="../@colSpan"/>
  651. </colspan>
  652. </xsl:when>
  653. </xsl:choose>
  654. <ccs:type>TextFrame</ccs:type>
  655. <ccs:content>
  656. <ccs:textFrame>
  657. <!-- SFJ: add the drill information -->
  658. <xsl:if test="../../drillTargets">
  659. <xsl:for-each select="../../drillTargets/drillTarget">
  660. <ccs:drillTarget>
  661. <ccs:drillIndex>
  662. <xsl:value-of select="@drillIdx"/>
  663. </ccs:drillIndex>
  664. <xsl:for-each select="drillParameter">
  665. <ccs:drillParameter>
  666. <ccs:name>
  667. <xsl:value-of select="@name"/>
  668. </ccs:name>
  669. <ccs:value>
  670. <xsl:value-of select="@value"/>
  671. </ccs:value>
  672. </ccs:drillParameter>
  673. </xsl:for-each>
  674. </ccs:drillTarget>
  675. </xsl:for-each>
  676. </xsl:if>
  677. <ccs:value>
  678. <xsl:choose>
  679. <xsl:when test="($dataFmt='formattedData') or (string-length(@RawXML) = 0 )">
  680. <xsl:value-of select="."/>
  681. </xsl:when>
  682. <xsl:otherwise>
  683. <xsl:choose>
  684. <xsl:when test="@valueType = 'number' ">
  685. <xsl:value-of select="translate(@RawXML, ',', '.')"/>
  686. </xsl:when>
  687. <xsl:when test="@valueType = 'currency' ">
  688. <xsl:value-of select="translate(@RawXML, ',', '.')"/>
  689. </xsl:when>
  690. <xsl:when test="@valueType = 'percent' ">
  691. <xsl:value-of select="translate(@RawXML, ',', '.')"/>
  692. </xsl:when>
  693. <xsl:otherwise>
  694. <xsl:value-of select="@RawXML"/>
  695. </xsl:otherwise>
  696. </xsl:choose>
  697. </xsl:otherwise>
  698. </xsl:choose>
  699. </ccs:value>
  700. <ccs:dataFormat>
  701. <xsl:value-of select="@formatPatternExcel"/>
  702. </ccs:dataFormat>
  703. <ccs:valueType>
  704. <xsl:value-of select="@valueType"/>
  705. </ccs:valueType>
  706. </ccs:textFrame>
  707. </ccs:content>
  708. <xsl:call-template name="styles"/>
  709. </xsl:element>
  710. </xsl:if>
  711. </xsl:template>
  712. <xsl:template name="styles">
  713. <xsl:if test="string-length(../../../@class) &gt; 0">
  714. <ccs:preProcessedStyle>
  715. <xsl:value-of select="../../../@class"/>
  716. </ccs:preProcessedStyle>
  717. </xsl:if>
  718. <xsl:if test="string-length(../../../@style) &gt; 0">
  719. <ccs:unprocessedStyle>
  720. <xsl:value-of select="../../../@style"/>
  721. </ccs:unprocessedStyle>
  722. </xsl:if>
  723. <xsl:if test="string-length(../../@class) &gt; 0">
  724. <ccs:preProcessedStyle>
  725. <xsl:value-of select="../../@class"/>
  726. </ccs:preProcessedStyle>
  727. </xsl:if>
  728. <xsl:if test="string-length(../../@style) &gt; 0">
  729. <ccs:unprocessedStyle>
  730. <xsl:value-of select="../../@style"/>
  731. </ccs:unprocessedStyle>
  732. </xsl:if>
  733. <xsl:if test="string-length(../@class) &gt; 0">
  734. <ccs:preProcessedStyle>
  735. <xsl:value-of select="../@class"/>
  736. </ccs:preProcessedStyle>
  737. </xsl:if>
  738. <xsl:if test="string-length(../@style) &gt; 0">
  739. <ccs:unprocessedStyle>
  740. <xsl:value-of select="../@style"/>
  741. </ccs:unprocessedStyle>
  742. </xsl:if>
  743. <xsl:if test="string-length(@class) &gt; 0">
  744. <ccs:preProcessedStyle>
  745. <xsl:value-of select="@class"/>
  746. </ccs:preProcessedStyle>
  747. </xsl:if>
  748. <xsl:if test="string-length(@style) &gt; 0">
  749. <ccs:unprocessedStyle>
  750. <xsl:value-of select="@style"/>
  751. </ccs:unprocessedStyle>
  752. </xsl:if>
  753. </xsl:template>
  754. <!-- SFJ: drill-through support -->
  755. <xsl:template match="DRILL">
  756. <ccs:drill>
  757. <ccs:cmPath>
  758. <xsl:value-of select="@path"/>
  759. </ccs:cmPath>
  760. <ccs:label>
  761. <xsl:value-of select="@label"/>
  762. </ccs:label>
  763. <xsl:copy-of select="*"/>
  764. </ccs:drill>
  765. </xsl:template>
  766. </xsl:stylesheet>