RSUpgradeCommonChart.xsl 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rspecupgrade
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <!-- COPYRIGHT_DATA { 'YEAR':[2005, 2009], 'RELEASE':['colorado_wave1'], 'VISIBLE':'YES', 'COMPONENT':'rspecupgrade' }-->
  10. <!--All lines above the COPYRIGHT_DATA line will be replaced when copyright notices are generated. -->
  11. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:baltic="http://developer.cognos.com/schemas/report/1/" xmlns="http://developer.cognos.com/schemas/report/2.0/" xmlns:date="http://exslt.org/dates-and-times" xmlns:exsl="http://exslt.org/common" xmlns:xalan="http://xml.apache.org/xalan" xmlns:java="http://xml.apache.org/xalan/java" extension-element-prefixes="xalan date exsl" exclude-result-prefixes="xalan java baltic date exsl">
  12. <xsl:template match="baltic:background">
  13. <fillEffects>
  14. <xsl:apply-templates select="baltic:wash"/>
  15. <xsl:apply-templates select="baltic:pattern"/>
  16. </fillEffects>
  17. </xsl:template>
  18. <xsl:template match="baltic:wash">
  19. <chartGradient>
  20. <xsl:attribute name="direction"><xsl:choose><xsl:when test="@washDirection"><xsl:value-of select="@washDirection"/></xsl:when><xsl:otherwise>down</xsl:otherwise></xsl:choose></xsl:attribute>
  21. <xsl:if test="@fromColor">
  22. <xsl:attribute name="fromColor"><xsl:value-of select="@fromColor"/></xsl:attribute>
  23. </xsl:if>
  24. <xsl:if test="@toColor">
  25. <xsl:attribute name="toColor"><xsl:value-of select="@toColor"/></xsl:attribute>
  26. </xsl:if>
  27. </chartGradient>
  28. </xsl:template>
  29. <xsl:template match="baltic:pattern">
  30. <chartPattern>
  31. <xsl:if test="@patternType">
  32. <xsl:attribute name="patternType"><xsl:choose><xsl:when test="@patternType = 'transparentCrossDiagonal'">diagonalCross</xsl:when><xsl:when test="@patternType = 'transparentCross'">cross</xsl:when><xsl:when test="@patternType = 'transparentBackDiagonal'">backwardDiagonal</xsl:when><xsl:when test="@patternType = 'transparentForwardDiagonal'">forwardDiagonal</xsl:when><xsl:when test="@patternType = 'transparentVertical'">vertical</xsl:when><xsl:when test="@patternType = 'transparentHorizontal'">horizontal</xsl:when><xsl:when test="@patternType = 'solid'">horizontal</xsl:when><xsl:when test="@patternType = 'solidCrossDiagonal'">diagonalCross</xsl:when><xsl:when test="@patternType = 'solidCross'">cross</xsl:when><xsl:when test="@patternType = 'solidBackDiagonal'">backwardDiagonal</xsl:when><xsl:when test="@patternType = 'solidForwardDiagonal'">forwardDiagonal</xsl:when><xsl:when test="@patternType = 'solidVertical'">vertical</xsl:when><xsl:when test="@patternType = 'solidHorizontal'">horizontal</xsl:when></xsl:choose></xsl:attribute>
  33. </xsl:if>
  34. <xsl:if test="@direction">
  35. <xsl:attribute name="direction"><xsl:value-of select="@direction"/></xsl:attribute>
  36. </xsl:if>
  37. <xsl:if test="@color2 != ''">
  38. <xsl:attribute name="foregroundColor"><xsl:value-of select="@color2"/></xsl:attribute>
  39. </xsl:if>
  40. <xsl:if test="@color1 != ''">
  41. <xsl:attribute name="backgroundColor"><xsl:value-of select="@color1"/></xsl:attribute>
  42. </xsl:if>
  43. </chartPattern>
  44. </xsl:template>
  45. <xsl:template match="baltic:color">
  46. <chartColor>
  47. <xsl:if test="@value">
  48. <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute>
  49. </xsl:if>
  50. </chartColor>
  51. </xsl:template>
  52. <xsl:template match="baltic:chartPalette">
  53. <chartPalette>
  54. <xsl:apply-templates/>
  55. </chartPalette>
  56. </xsl:template>
  57. <xsl:template match="baltic:chartBody">
  58. <xsl:if test="baltic:background or baltic:style">
  59. <chartBody>
  60. <xsl:apply-templates select="baltic:background"/>
  61. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  62. </chartBody>
  63. </xsl:if>
  64. </xsl:template>
  65. <xsl:template name="commonChartMarkerTemplate">
  66. <xsl:param name="p_chart" select="."/>
  67. <xsl:variable name="v_showMarkers" select="$p_chart/@showMarkers"/>
  68. <xsl:if test="baltic:marker">
  69. <xsl:element name="markers">
  70. <xsl:if test="$v_showMarkers != ''">
  71. <xsl:attribute name="markerTextLocation"><xsl:value-of select="$v_showMarkers"/></xsl:attribute>
  72. </xsl:if>
  73. <xsl:for-each select="baltic:marker">
  74. <xsl:call-template name="commonMarkerTemplate">
  75. <xsl:with-param name="markerElementName" select="'marker'"/>
  76. <xsl:with-param name="positioningElementName" select="'markerPosition'"/>
  77. </xsl:call-template>
  78. </xsl:for-each>
  79. </xsl:element>
  80. </xsl:if>
  81. </xsl:template>
  82. <xsl:template name="pointChartMarkerTemplate">
  83. <xsl:param name="p_chart" select="."/>
  84. <xsl:variable name="v_showMarkers" select="$p_chart/@showMarkers"/>
  85. <xsl:if test="baltic:marker">
  86. <xsl:element name="pointChartMarkers">
  87. <xsl:if test="$v_showMarkers != ''">
  88. <xsl:attribute name="markerTextLocation"><xsl:value-of select="$v_showMarkers"/></xsl:attribute>
  89. </xsl:if>
  90. <xsl:for-each select="baltic:marker">
  91. <xsl:call-template name="commonMarkerTemplate">
  92. <xsl:with-param name="markerElementName" select="'pointChartMarker'"/>
  93. <xsl:with-param name="positioningElementName" select="'pointChartMarkerPosition'"/>
  94. </xsl:call-template>
  95. </xsl:for-each>
  96. </xsl:element>
  97. </xsl:if>
  98. </xsl:template>
  99. <xsl:template name="commonMarkerTemplate">
  100. <xsl:param name="markerElementName"/>
  101. <xsl:param name="positioningElementName"/>
  102. <xsl:param name="p_marker" select="."/>
  103. <xsl:variable name="dataPointColor">
  104. <xsl:if test="baltic:style">
  105. <xsl:call-template name="getColorFromCSSTemplate">
  106. <xsl:with-param name="inputString" select="normalize-space(baltic:style[1]/baltic:CSS/@value)"/>
  107. </xsl:call-template>
  108. </xsl:if>
  109. </xsl:variable>
  110. <xsl:variable name="v_yPosition">
  111. <xsl:choose>
  112. <xsl:when test="$p_marker/@yPosition">
  113. <xsl:value-of select="$p_marker/@yPosition"/>
  114. </xsl:when>
  115. <xsl:otherwise>0</xsl:otherwise>
  116. </xsl:choose>
  117. </xsl:variable>
  118. <xsl:element name="{$markerElementName}">
  119. <xsl:call-template name="dataPointTemplate"/>
  120. <xsl:if test="$dataPointColor!=''">
  121. <xsl:attribute name="dataPointColor"><xsl:value-of select="$dataPointColor"/></xsl:attribute>
  122. </xsl:if>
  123. <xsl:element name="{$positioningElementName}">
  124. <xsl:choose>
  125. <xsl:when test="$positioningElementName='markerPosition'">
  126. <numericPosition>
  127. <dataSource>
  128. <staticValue>
  129. <xsl:value-of select="$v_yPosition"/>
  130. </staticValue>
  131. </dataSource>
  132. </numericPosition>
  133. <memberPosition>
  134. <reportExpression>
  135. <xsl:value-of select="$p_marker/@xPosition"/>
  136. </reportExpression>
  137. </memberPosition>
  138. </xsl:when>
  139. <xsl:otherwise>
  140. <XPosition>
  141. <dataSource>
  142. <staticValue>
  143. <xsl:value-of select="$p_marker/@xPosition"/>
  144. </staticValue>
  145. </dataSource>
  146. </XPosition>
  147. <YPosition>
  148. <dataSource>
  149. <staticValue>
  150. <xsl:value-of select="$v_yPosition"/>
  151. </staticValue>
  152. </dataSource>
  153. </YPosition>
  154. </xsl:otherwise>
  155. </xsl:choose>
  156. </xsl:element>
  157. <xsl:call-template name="chartContentsLabelTemplate">
  158. <xsl:with-param name="labelName" select="'markerLabel'"/>
  159. </xsl:call-template>
  160. </xsl:element>
  161. </xsl:template>
  162. <xsl:template name="commonChartBaselineTemplate">
  163. <xsl:param name="chartType"/>
  164. <xsl:param name="standardType"/>
  165. <xsl:if test="baltic:statistics[@function='baseLine']">
  166. <baselines>
  167. <xsl:for-each select="baltic:statistics">
  168. <xsl:if test="@function='baseLine'">
  169. <xsl:call-template name="chartBaselineTemplate">
  170. <xsl:with-param name="chartType" select="$chartType"/>
  171. <xsl:with-param name="standardType" select="$standardType"/>
  172. <xsl:with-param name="baselineElementName" select="'baseline'"/>
  173. <xsl:with-param name="positioningElementName" select="'baselinePosition'"/>
  174. </xsl:call-template>
  175. </xsl:if>
  176. </xsl:for-each>
  177. </baselines>
  178. </xsl:if>
  179. </xsl:template>
  180. <xsl:template name="commonPointChartBaselineTemplate">
  181. <xsl:param name="chartType"/>
  182. <xsl:param name="standardType"/>
  183. <xsl:choose>
  184. <xsl:when test="$chartType = 'quadrantChart'">
  185. <pointChartBaselines>
  186. <!-- puts in the X and Y quadrant lines, these become baselines in V5 -->
  187. <xsl:call-template name="quadrantLineTemplate">
  188. <xsl:with-param name="axisPosition" select="'xPosition'"/>
  189. <xsl:with-param name="percentAlongAxis" select="baltic:quadrantChart/@xPosition"/>
  190. </xsl:call-template>
  191. <xsl:call-template name="quadrantLineTemplate">
  192. <xsl:with-param name="axisPosition" select="'yPosition'"/>
  193. <xsl:with-param name="percentAlongAxis" select="baltic:quadrantChart/@yPosition"/>
  194. </xsl:call-template>
  195. <xsl:for-each select="baltic:statistics">
  196. <xsl:if test="@function='baseLine'">
  197. <xsl:call-template name="chartBaselineTemplate">
  198. <xsl:with-param name="chartType" select="$chartType"/>
  199. <xsl:with-param name="standardType" select="$standardType"/>
  200. <xsl:with-param name="baselineElementName" select="'pointChartBaseline'"/>
  201. <xsl:with-param name="positioningElementName" select="'pointChartBaselinePosition'"/>
  202. </xsl:call-template>
  203. </xsl:if>
  204. </xsl:for-each>
  205. </pointChartBaselines>
  206. </xsl:when>
  207. <xsl:otherwise>
  208. <xsl:if test="baltic:statistics[@function='baseLine']">
  209. <pointChartBaselines>
  210. <xsl:for-each select="baltic:statistics">
  211. <xsl:if test="@function='baseLine'">
  212. <xsl:call-template name="chartBaselineTemplate">
  213. <xsl:with-param name="chartType" select="$chartType"/>
  214. <xsl:with-param name="standardType" select="$standardType"/>
  215. <xsl:with-param name="baselineElementName" select="'pointChartBaseline'"/>
  216. <xsl:with-param name="positioningElementName" select="'pointChartBaselinePosition'"/>
  217. </xsl:call-template>
  218. </xsl:if>
  219. </xsl:for-each>
  220. </pointChartBaselines>
  221. </xsl:if>
  222. </xsl:otherwise>
  223. </xsl:choose>
  224. </xsl:template>
  225. <xsl:template name="threeDComboBaselineTemplate">
  226. <xsl:param name="chartType"/>
  227. <xsl:param name="standardType"/>
  228. <xsl:if test="baltic:statistics[@function='baseLine']">
  229. <threeDComboBaselines>
  230. <xsl:for-each select="baltic:statistics">
  231. <xsl:if test="@function='baseLine'">
  232. <xsl:call-template name="chartBaselineTemplate">
  233. <xsl:with-param name="chartType" select="$chartType"/>
  234. <xsl:with-param name="standardType" select="$standardType"/>
  235. <xsl:with-param name="baselineElementName" select="'threeDComboBaseline'"/>
  236. <xsl:with-param name="positioningElementName" select="'threeDBaselinePosition'"/>
  237. </xsl:call-template>
  238. </xsl:if>
  239. </xsl:for-each>
  240. </threeDComboBaselines>
  241. </xsl:if>
  242. </xsl:template>
  243. <xsl:template name="threeDScatterBaselineTemplate">
  244. <xsl:param name="chartType"/>
  245. <xsl:param name="standardType"/>
  246. <xsl:if test="baltic:statistics[@function='baseLine']">
  247. <threeDScatterBaselines>
  248. <xsl:for-each select="baltic:statistics">
  249. <xsl:if test="@function='baseLine'">
  250. <xsl:call-template name="chartBaselineTemplate">
  251. <xsl:with-param name="chartType" select="$chartType"/>
  252. <xsl:with-param name="standardType" select="$standardType"/>
  253. <xsl:with-param name="baselineElementName" select="'threeDScatterBaseline'"/>
  254. <xsl:with-param name="positioningElementName" select="'threeDBaselinePosition'"/>
  255. </xsl:call-template>
  256. </xsl:if>
  257. </xsl:for-each>
  258. </threeDScatterBaselines>
  259. </xsl:if>
  260. </xsl:template>
  261. <xsl:template name="chartBaselineTemplate">
  262. <xsl:param name="chartType"/>
  263. <xsl:param name="standardType"/>
  264. <xsl:param name="baselineElementName"/>
  265. <xsl:param name="positioningElementName"/>
  266. <!--Get baseline color-->
  267. <xsl:variable name="color">
  268. <xsl:if test="baltic:style">
  269. <xsl:call-template name="getColorFromCSSTemplate">
  270. <xsl:with-param name="inputString" select="normalize-space(baltic:style[1]/baltic:CSS/@value)"/>
  271. </xsl:call-template>
  272. </xsl:if>
  273. </xsl:variable>
  274. <!--Get baseline useNumericalAxis-->
  275. <xsl:variable name="useNumericalAxis">
  276. <xsl:call-template name="getUseNumericalAxisTemplate">
  277. <xsl:with-param name="chartType" select="$chartType"/>
  278. <xsl:with-param name="standardType" select="$standardType"/>
  279. <xsl:with-param name="axisPosition" select="@axisPosition"/>
  280. </xsl:call-template>
  281. </xsl:variable>
  282. <xsl:element name="{$baselineElementName}">
  283. <!-- line style attribute-->
  284. <xsl:call-template name="lineStyleTemplate">
  285. <xsl:with-param name="p_lineStyle" select="@lineStyle"/>
  286. </xsl:call-template>
  287. <!-- line color attribute-->
  288. <xsl:if test="$color!=''">
  289. <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
  290. </xsl:if>
  291. <xsl:if test="$chartType='bubbleChart' or $chartType='polarChart' or $chartType='quadrantChart' or $chartType='scatterChart'">
  292. <!-- useNumericalAxis attribute-->
  293. <xsl:if test="$useNumericalAxis!=''">
  294. <xsl:attribute name="pointChartAxis"><xsl:value-of select="$useNumericalAxis"/></xsl:attribute>
  295. </xsl:if>
  296. </xsl:if>
  297. <xsl:element name="{$positioningElementName}">
  298. <xsl:if test="$chartType='areaChart' or $chartType='barChart' or $chartType='columnChart' or $chartType='lineChart' or $chartType='combinationChart' or $chartType='paretoChart' or $chartType='progressiveChart' or $chartType='radarChart'">
  299. <xsl:if test="$useNumericalAxis = 'numericalAxisY1' or $useNumericalAxis = 'numericalAxisY2' or $useNumericalAxis = 'radialAxis'">
  300. <!-- useNumericalAxis attribute-->
  301. <xsl:attribute name="useNumericalAxis"><xsl:value-of select="$useNumericalAxis"/></xsl:attribute>
  302. </xsl:if>
  303. </xsl:if>
  304. <xsl:choose>
  305. <xsl:when test="$useNumericalAxis = 'ordinalAxisX'">
  306. <memberPosition>
  307. <reportExpression>
  308. <xsl:value-of select="@customValue"/>
  309. </reportExpression>
  310. </memberPosition>
  311. </xsl:when>
  312. <xsl:otherwise>
  313. <xsl:choose>
  314. <xsl:when test="$chartType = 'bubbleChart' or $chartType = 'polarChart' or $chartType = 'quadrantChart' or $chartType = 'scatterChart' or $standardType = '3DAxis'">
  315. <dataSource>
  316. <staticValue>
  317. <xsl:value-of select="@customValue"/>
  318. </staticValue>
  319. </dataSource>
  320. </xsl:when>
  321. <xsl:otherwise>
  322. <numericPosition>
  323. <xsl:choose>
  324. <xsl:when test="$standardType = 'percent'">
  325. <!--for percent, customValue is always define as x/100, therefore multiply by 100 for V5-->
  326. <percentAlongAxis>
  327. <xsl:attribute name="percentAlongAxis"><xsl:value-of select="number(@customValue)*100"/></xsl:attribute>
  328. </percentAlongAxis>
  329. </xsl:when>
  330. <xsl:otherwise>
  331. <dataSource>
  332. <staticValue>
  333. <xsl:value-of select="@customValue"/>
  334. </staticValue>
  335. </dataSource>
  336. </xsl:otherwise>
  337. </xsl:choose>
  338. </numericPosition>
  339. </xsl:otherwise>
  340. </xsl:choose>
  341. </xsl:otherwise>
  342. </xsl:choose>
  343. </xsl:element>
  344. <xsl:if test="$standardType != '3DAxis'">
  345. <xsl:call-template name="chartContentsLabelTemplate">
  346. <xsl:with-param name="labelName" select="'baselineLabel'"/>
  347. </xsl:call-template>
  348. </xsl:if>
  349. </xsl:element>
  350. </xsl:template>
  351. <xsl:template name="getUseNumericalAxisTemplate">
  352. <xsl:param name="chartType"/>
  353. <xsl:param name="standardType"/>
  354. <xsl:param name="axisPosition"/>
  355. <xsl:choose>
  356. <xsl:when test="$chartType = 'bubbleChart' or $chartType = 'quadrantChart' or $chartType = 'scatterChart'">
  357. <xsl:choose>
  358. <xsl:when test="$axisPosition='X'">
  359. <xsl:value-of select="'xAxis'"/>
  360. </xsl:when>
  361. <xsl:otherwise>
  362. <!--Default value in V4 is "Y1". Therefore, carry this default over when no value is specified-->
  363. <xsl:text>yAxis</xsl:text>
  364. </xsl:otherwise>
  365. </xsl:choose>
  366. </xsl:when>
  367. <xsl:when test="$chartType = 'polarChart'">
  368. <xsl:choose>
  369. <xsl:when test="$axisPosition='X'">
  370. <xsl:value-of select="'angularAxis'"/>
  371. </xsl:when>
  372. <xsl:otherwise>
  373. <!--Default value in V4 is "Y1". Therefore, carry this default over when no value is specified-->
  374. <xsl:text>radialAxis</xsl:text>
  375. </xsl:otherwise>
  376. </xsl:choose>
  377. </xsl:when>
  378. <xsl:when test="$standardType != '3DAxis'">
  379. <!--3D combination charts in V5, the baseline is always occur on the Z-axis.
  380. Since Z-axis is the mandatory axis for 3D charts, there are no V5 defintion for "useNumericalAxis" for 3D charts
  381. -->
  382. <xsl:choose>
  383. <xsl:when test="$axisPosition='X'">
  384. <xsl:value-of select="'ordinalAxisX'"/>
  385. </xsl:when>
  386. <xsl:when test="$axisPosition='Y1'">
  387. <xsl:value-of select="'numericalAxisY1'"/>
  388. </xsl:when>
  389. <xsl:when test="$axisPosition='Y2'">
  390. <xsl:value-of select="'numericalAxisY2'"/>
  391. </xsl:when>
  392. </xsl:choose>
  393. </xsl:when>
  394. </xsl:choose>
  395. </xsl:template>
  396. <xsl:template name="chartContentsLabelTemplate">
  397. <xsl:param name="labelName"/>
  398. <xsl:element name="{$labelName}">
  399. <chartContents>
  400. <xsl:for-each select="baltic:chartText">
  401. <xsl:call-template name="chartTextGroupTemplate"/>
  402. </xsl:for-each>
  403. </chartContents>
  404. </xsl:element>
  405. </xsl:template>
  406. <xsl:template match="baltic:note">
  407. <note>
  408. <xsl:if test="@refQuery">
  409. <xsl:variable name="var_beringRefQuery">
  410. <xsl:call-template name="getQueryTemplate">
  411. <xsl:with-param name="refQuery" select="@refQuery"/>
  412. </xsl:call-template>
  413. </xsl:variable>
  414. <xsl:attribute name="refQuery"><xsl:value-of select="$var_beringRefQuery"/></xsl:attribute>
  415. <!-- originalRefQuery is used when looking up the Baltic query from Bering context, and will be removed in later stages. -->
  416. <xsl:attribute name="originalRefQuery"><xsl:value-of select="@refQuery"/></xsl:attribute>
  417. </xsl:if>
  418. <xsl:if test="@noteWidth">
  419. <xsl:attribute name="width"><xsl:value-of select="@noteWidth"/></xsl:attribute>
  420. </xsl:if>
  421. <xsl:if test="@noteHeight">
  422. <xsl:attribute name="height"><xsl:value-of select="@noteHeight"/></xsl:attribute>
  423. </xsl:if>
  424. <xsl:if test="@noteLeft">
  425. <xsl:attribute name="left"><xsl:value-of select="@noteLeft"/></xsl:attribute>
  426. </xsl:if>
  427. <xsl:if test="@noteTop">
  428. <xsl:attribute name="bottom"><xsl:value-of select="number(@noteTop)-number(@noteHeight)"/></xsl:attribute>
  429. </xsl:if>
  430. <noteContent>
  431. <chartContents>
  432. <xsl:for-each select="baltic:chartText">
  433. <xsl:call-template name="chartPlainTextTemplate"/>
  434. </xsl:for-each>
  435. </chartContents>
  436. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  437. </noteContent>
  438. <xsl:if test="@lineStyle">
  439. <noteBorder>
  440. <xsl:call-template name="lineStyleTemplate"/>
  441. </noteBorder>
  442. </xsl:if>
  443. </note>
  444. </xsl:template>
  445. <xsl:template match="baltic:categoryItemTruncationText">
  446. <truncationText>
  447. <xsl:call-template name="chartTextGroupTemplate"/>
  448. </truncationText>
  449. </xsl:template>
  450. <!-- named templates/helpers -->
  451. <xsl:template name="chartTextTemplate">
  452. <xsl:call-template name="chartTextAttributesTemplate"/>
  453. <xsl:call-template name="chartTextGroupTemplate"/>
  454. </xsl:template>
  455. <xsl:template name="chartPlainTextTemplate">
  456. <xsl:call-template name="chartTextAttributesTemplate"/>
  457. <xsl:call-template name="chartTextGroupTemplate"/>
  458. </xsl:template>
  459. <xsl:template match="baltic:chartText">
  460. <xsl:call-template name="chartTextGroupTemplate"/>
  461. </xsl:template>
  462. <xsl:template name="chartTextGroupTemplate">
  463. <xsl:param name="p_cur" select="."/>
  464. <chartTextItem>
  465. <xsl:if test="$p_cur/baltic:text[not(@refVariableValue)] or $p_cur/baltic:expression or $p_cur/baltic:queryItemRef">
  466. <dataSource>
  467. <xsl:apply-templates select="$p_cur/baltic:text[not(@refVariableValue)]"/>
  468. <xsl:apply-templates select="comment()"/>
  469. <!-- Harvest comments in case there were expression parsing errors. -->
  470. <xsl:apply-templates select="$p_cur/baltic:expression"/>
  471. <xsl:apply-templates select="$p_cur/baltic:queryItemRef"/>
  472. </dataSource>
  473. </xsl:if>
  474. <xsl:variable name="v_refVariableExists">
  475. <xsl:call-template name="checkRefVariableTemplate">
  476. <xsl:with-param name="p_cur" select="$p_cur"/>
  477. </xsl:call-template>
  478. </xsl:variable>
  479. <xsl:if test="count($p_cur/@refVariable) = 1 and $v_refVariableExists = 'true' and count($p_cur/baltic:text[@refVariableValue]) &gt; 0">
  480. <conditionalDataSources>
  481. <xsl:attribute name="refVariable"><xsl:value-of select="$p_cur/@refVariable"/></xsl:attribute>
  482. <xsl:apply-templates select="$p_cur/baltic:text[@refVariableValue]"/>
  483. </conditionalDataSources>
  484. </xsl:if>
  485. <xsl:call-template name="simpleLayoutGroupTemplate">
  486. <xsl:with-param name="p_cur" select="$p_cur"/>
  487. </xsl:call-template>
  488. </chartTextItem>
  489. </xsl:template>
  490. <xsl:template name="chartTextAttributesTemplate">
  491. <!-- tbd -->
  492. </xsl:template>
  493. <xsl:template name="chartLevelTemplate">
  494. <xsl:param name="p_mode"/>
  495. <xsl:param name="p_base" select="."/>
  496. <xsl:param name="p_addChartContents" select="'true'"/>
  497. <xsl:param name="p_pos" select="'1'"/>
  498. <xsl:param name="p_checkMeasures" select="'conditionally'"/>
  499. <xsl:param name="p_testMoveMeasureToColEdge" select="0"/>
  500. <xsl:variable name="v_refQuery" select="@refQuery"/>
  501. <xsl:variable name="v_cube">
  502. <xsl:call-template name="getCubeOrCubeReference">
  503. <xsl:with-param name="p_queryNode" select="//baltic:BIQuery[@name=$v_refQuery]"/>
  504. </xsl:call-template>
  505. </xsl:variable>
  506. <xsl:variable name="v_measureOnColEdge">
  507. <xsl:choose>
  508. <xsl:when test="//baltic:BIQuery[@name=$v_refQuery]/baltic:summary/baltic:columnEdge/baltic:cellMembers">1</xsl:when>
  509. <xsl:otherwise>0</xsl:otherwise>
  510. </xsl:choose>
  511. </xsl:variable>
  512. <xsl:variable name="v_levelOnColEdge">
  513. <xsl:choose>
  514. <xsl:when test="//baltic:BIQuery[@name=$v_refQuery]/baltic:summary/baltic:columnEdge/baltic:level">1</xsl:when>
  515. <xsl:otherwise>0</xsl:otherwise>
  516. </xsl:choose>
  517. </xsl:variable>
  518. <xsl:variable name="v_chartNodes">
  519. <xsl:call-template name="checkSummaryLevelTemplate">
  520. <xsl:with-param name="p_mode" select="$p_mode"/>
  521. <xsl:with-param name="p_base" select="$p_base"/>
  522. </xsl:call-template>
  523. <xsl:choose>
  524. <xsl:when test="count($p_base/baltic:chartMeasure) &gt; 1 and $p_checkMeasures = 'yes'">1</xsl:when>
  525. <xsl:when test="count($p_base/baltic:chartMeasure) &gt; 1 and $p_checkMeasures = 'conditionally'">1</xsl:when>
  526. <!-- These next two are to test for the case when you have one default measure, and no level on the column edge.
  527. In this case, put the measure on the column edge so that the labels will show up properly. -->
  528. <xsl:when test="$p_testMoveMeasureToColEdge = 1 and count($p_base/baltic:chartMeasure) = 1 and $v_levelOnColEdge = 1">0</xsl:when>
  529. <xsl:when test="$p_testMoveMeasureToColEdge = 1 and count($p_base/baltic:chartMeasure) = 1 and $v_measureOnColEdge = 1">1</xsl:when>
  530. <xsl:otherwise>0</xsl:otherwise>
  531. </xsl:choose>
  532. </xsl:variable>
  533. <xsl:if test="$v_chartNodes != 0">
  534. <xsl:variable name="v_measures">
  535. <xsl:call-template name="chartNodeTemplate">
  536. <xsl:with-param name="p_cube" select="$v_cube/baltic:cube"/>
  537. <xsl:with-param name="p_refQuery" select="$v_refQuery"/>
  538. <xsl:with-param name="p_mode" select="$p_mode"/>
  539. <xsl:with-param name="p_base" select="$p_base"/>
  540. <xsl:with-param name="p_addChartContents" select="$p_addChartContents"/>
  541. <xsl:with-param name="p_pos" select="$p_pos"/>
  542. <xsl:with-param name="p_checkMeasures" select="$p_checkMeasures"/>
  543. </xsl:call-template>
  544. </xsl:variable>
  545. <xsl:if test="$v_measures/*">
  546. <chartNodes>
  547. <xsl:copy-of select="$v_measures"/>
  548. </chartNodes>
  549. </xsl:if>
  550. </xsl:if>
  551. </xsl:template>
  552. <xsl:template name="chooseEdgeAndPlaceMeasuresTemplate">
  553. <!-- In the summary section of a v4 chart query, you can place cellMembers on the
  554. rowEdge or on the columnEdge. On which edge it is determines where multiple
  555. measures go in the v5 spec. For example, for an area chart, it determines
  556. if the multiple measures go on the commonClusters or on combinationChartTypes/area.
  557. -->
  558. <xsl:param name="p_refQuery"/>
  559. <xsl:param name="p_mode"/>
  560. <xsl:param name="p_checkMeasures" select="'never'"/>
  561. <xsl:param name="p_cube"/>
  562. <xsl:param name="p_base" select="."/>
  563. <xsl:param name="p_addNestedNode" select="'false'"/>
  564. <xsl:variable name="v_placeMeasures">
  565. <xsl:choose>
  566. <xsl:when test="$p_checkMeasures = 'never'">false</xsl:when>
  567. <xsl:when test="$p_checkMeasures = 'yes'">true</xsl:when>
  568. <xsl:when test="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:rowEdge/baltic:cellMembers and $p_checkMeasures = 'conditionally'">
  569. <xsl:if test="$p_mode = 'rowEdge'">true</xsl:if>
  570. </xsl:when>
  571. <xsl:when test="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:columnEdge/baltic:cellMembers and $p_checkMeasures = 'conditionally'">
  572. <xsl:if test="$p_mode = 'columnEdge'">true</xsl:if>
  573. </xsl:when>
  574. <xsl:when test="not(//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:columnEdge/baltic:cellMembers) and not(//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:rowEdge/baltic:cellMembers) and $p_checkMeasures = 'conditionally'">
  575. <xsl:choose>
  576. <xsl:when test="//baltic:chart[@refQuery=$p_refQuery]/pieChart and $p_mode = 'categoryEdge'">true</xsl:when>
  577. <xsl:when test="not(//baltic:chart[@refQuery=$p_refQuery]/pieChart) and $p_mode = 'rowEdge'">true</xsl:when>
  578. </xsl:choose>
  579. </xsl:when>
  580. <xsl:otherwise>false</xsl:otherwise>
  581. </xsl:choose>
  582. </xsl:variable>
  583. <xsl:if test="$v_placeMeasures = 'true'">
  584. <xsl:if test="$p_addNestedNode = 'false'">
  585. <chartNodeMembers>
  586. <xsl:call-template name="processChartMeasuresTemplate">
  587. <xsl:with-param name="p_cube" select="$p_cube"/>
  588. <xsl:with-param name="p_base" select="$p_base"/>
  589. </xsl:call-template>
  590. </chartNodeMembers>
  591. </xsl:if>
  592. <xsl:if test="$p_addNestedNode = 'true'">
  593. <chartNestedNodes>
  594. <chartNode>
  595. <chartNodeMembers>
  596. <xsl:call-template name="processChartMeasuresTemplate">
  597. <xsl:with-param name="p_cube" select="$p_cube"/>
  598. <xsl:with-param name="p_base" select="$p_base"/>
  599. </xsl:call-template>
  600. </chartNodeMembers>
  601. </chartNode>
  602. </chartNestedNodes>
  603. </xsl:if>
  604. </xsl:if>
  605. </xsl:template>
  606. <xsl:template name="chartNodeTemplate">
  607. <xsl:param name="p_cube"/>
  608. <xsl:param name="p_refQuery"/>
  609. <xsl:param name="p_mode"/>
  610. <xsl:param name="p_base" select="."/>
  611. <xsl:param name="p_addChartContents" select="'true'"/>
  612. <xsl:param name="p_pos" select="'1'"/>
  613. <xsl:param name="p_checkMeasures"/>
  614. <xsl:variable name="v_checkMeasures">
  615. <xsl:choose>
  616. <xsl:when test="$p_checkMeasures = 'yes'">yes</xsl:when>
  617. <xsl:when test="$p_checkMeasures = 'conditionally' and count($p_base/baltic:chartMeasure) &gt; 1">conditionally</xsl:when>
  618. <xsl:otherwise>never</xsl:otherwise>
  619. </xsl:choose>
  620. </xsl:variable>
  621. <xsl:variable name="v_currentLevelName" select="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:*[local-name(.)=$p_mode]/baltic:level[position()=$p_pos]/@refLevel"/>
  622. <xsl:variable name="v_currentChartLevel" select="$p_base/baltic:chartLevel[@refLevel=$v_currentLevelName]"/>
  623. <xsl:variable name="v_currentLevelItemRef">
  624. <xsl:call-template name="getKeyItemNameForLevel">
  625. <xsl:with-param name="p_level" select="$p_cube//baltic:level[@name=$v_currentLevelName]"/>
  626. </xsl:call-template>
  627. </xsl:variable>
  628. <xsl:variable name="v_chartNodeMembersExist">
  629. <xsl:if test="count($v_currentChartLevel) = 1 or $v_checkMeasures = 'yes'">yes</xsl:if>
  630. <xsl:if test="count($v_currentChartLevel) = 1 or $v_checkMeasures = 'conditionally'">yes</xsl:if>
  631. </xsl:variable>
  632. <xsl:variable name="v_currentRefDataItem">
  633. <xsl:value-of select="$v_currentLevelItemRef"/>
  634. </xsl:variable>
  635. <xsl:variable name="staticChartLabel">
  636. <xsl:choose>
  637. <xsl:when test="$v_currentLevelName != $v_currentLevelItemRef">true</xsl:when>
  638. <xsl:otherwise>false</xsl:otherwise>
  639. </xsl:choose>
  640. </xsl:variable>
  641. <!-- Are the measures on the column. 1=yes 0=no -->
  642. <xsl:variable name="v_measureOnColEdge">
  643. <xsl:choose>
  644. <xsl:when test="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:columnEdge/baltic:cellMembers">1</xsl:when>
  645. <xsl:otherwise>0</xsl:otherwise>
  646. </xsl:choose>
  647. </xsl:variable>
  648. <!-- Are the measures on the row. 1=yes 0=no )-->
  649. <xsl:variable name="v_measureOnRowEdge">
  650. <xsl:choose>
  651. <xsl:when test="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:rowEdge/baltic:cellMembers">1</xsl:when>
  652. <xsl:otherwise>0</xsl:otherwise>
  653. </xsl:choose>
  654. </xsl:variable>
  655. <!-- Should chartLabels be generated. 1=yes 0=no
  656. * Do not generate labels if ANY measure has text, and the measures are going to become nestedNodes of the
  657. * node we are generating.
  658. -->
  659. <xsl:variable name="v_generateChartLabel">
  660. <xsl:choose>
  661. <xsl:when test="(($p_mode='rowEdge' and $v_measureOnRowEdge='1') or ($p_mode='columnEdge' and $v_measureOnColEdge='1')) and $p_base/baltic:chartMeasure/baltic:chartText/baltic:text">0</xsl:when>
  662. <xsl:otherwise>1</xsl:otherwise>
  663. </xsl:choose>
  664. </xsl:variable>
  665. <!-- Start of Debugging Information -->
  666. <!--<xsl:comment>Entering "chartNodeTemplate".</xsl:comment>
  667. <xsl:comment>
  668. <xsl:text>p_refQuery = </xsl:text>
  669. <xsl:value-of select="$p_refQuery"/>
  670. </xsl:comment>
  671. <xsl:comment>
  672. <xsl:text>p_mode = </xsl:text>
  673. <xsl:value-of select="$p_mode"/>
  674. </xsl:comment>
  675. <xsl:comment>
  676. <xsl:text>p_pos = </xsl:text>
  677. <xsl:value-of select="$p_pos"/>
  678. </xsl:comment>
  679. <xsl:comment>
  680. <xsl:text>p_checkMeasures = </xsl:text>
  681. <xsl:value-of select="$p_checkMeasures"/>
  682. </xsl:comment>
  683. <xsl:comment>
  684. <xsl:text>v_currentLevelName = </xsl:text>
  685. <xsl:value-of select="$v_currentLevelName"/>
  686. </xsl:comment>
  687. <xsl:comment>
  688. <xsl:text>v_currentLevelItemRef = </xsl:text>
  689. <xsl:value-of select="$v_currentLevelItemRef"/>
  690. </xsl:comment>
  691. <xsl:comment>
  692. <xsl:text>v_chartNodeMembersExist = </xsl:text>
  693. <xsl:value-of select="$v_chartNodeMembersExist"/>
  694. </xsl:comment>
  695. <xsl:comment>
  696. <xsl:text>v_currentRefDataItem = </xsl:text>
  697. <xsl:value-of select="$v_currentRefDataItem"/>
  698. </xsl:comment>
  699. <xsl:comment>
  700. <xsl:text>Start of v_currentChartLevel</xsl:text>
  701. </xsl:comment>
  702. <dump>
  703. <xsl:copy-of select="$v_currentChartLevel"/>
  704. </dump>
  705. <xsl:comment>
  706. <xsl:text>End of v_currentChartLevel</xsl:text>
  707. </xsl:comment>
  708. <xsl:comment>
  709. <xsl:text>v_measureOnColEdge = </xsl:text>
  710. <xsl:value-of select="$v_measureOnColEdge"/>
  711. </xsl:comment>
  712. <xsl:comment>
  713. <xsl:text>v_measureOnRowEdge = </xsl:text>
  714. <xsl:value-of select="$v_measureOnRowEdge"/>
  715. </xsl:comment>
  716. <xsl:comment>
  717. <xsl:text>v_generateChartLabel = </xsl:text>
  718. <xsl:value-of select="$v_generateChartLabel"/>
  719. </xsl:comment>
  720. -->
  721. <!-- End of Debugging Information -->
  722. <xsl:variable name="v_chartNodeContents">
  723. <xsl:choose>
  724. <xsl:when test="$v_chartNodeMembersExist != ''">
  725. <xsl:choose>
  726. <xsl:when test="count($v_currentChartLevel) = 1 or ($v_currentLevelName != '' and not($p_base/baltic:chartMeasure/baltic:member[@refMember=$v_currentLevelName]))">
  727. <chartNodeMembers>
  728. <chartNodeMember refDataItem="{$v_currentRefDataItem}">
  729. <chartContents>
  730. <chartTextItem>
  731. <dataSource>
  732. <xsl:choose>
  733. <xsl:when test="$v_generateChartLabel = '0'">
  734. <staticValue/>
  735. </xsl:when>
  736. <xsl:when test="count($v_currentChartLevel) = 1">
  737. <xsl:apply-templates select="$v_currentChartLevel/baltic:queryItemRef">
  738. <xsl:with-param name="p_currentRefDataItem" select="$v_currentRefDataItem"/>
  739. </xsl:apply-templates>
  740. </xsl:when>
  741. <xsl:otherwise>
  742. <dataItemValue refDataItem="{$v_currentRefDataItem}"/>
  743. </xsl:otherwise>
  744. </xsl:choose>
  745. </dataSource>
  746. <xsl:call-template name="simpleLayoutGroupTemplate">
  747. <xsl:with-param name="p_cur" select="$v_currentChartLevel"/>
  748. </xsl:call-template>
  749. </chartTextItem>
  750. </chartContents>
  751. <xsl:if test="$v_currentChartLevel/baltic:chartText and $v_generateChartLabel='1'">
  752. <chartLabel>
  753. <chartContents>
  754. <xsl:choose>
  755. <xsl:when test="$staticChartLabel = 'true'">
  756. <!--
  757. In Bering there is no equivalent refLevel support as in Baltic so turn the
  758. refLevel into staticValue to get equivalent labels get display as in Baltic.
  759. V4 example:
  760. ===========
  761. <chartLevel refLevel="Order method(Aging Buckets)">
  762. <queryItemRef refItem=""Order method"/>
  763. <chartText>
  764. <queryItemRef content="label" refItem="Order method"/>
  765. </chartText>
  766. <chartLevel>
  767. Resulting V5 is:
  768. ================
  769. <chartNodeMember refDataItem="Order method">
  770. <chartContents>
  771. <chartTextItem>
  772. <dataSource>
  773. <memberCaption/>
  774. </dataSource>
  775. </chartTextItem>
  776. </chartContents>
  777. <chartLabel>
  778. <chartContents>
  779. <chartTextItem>
  780. <dataSource>
  781. <staticValue>Order method(Aging Buckets)</staticValue>
  782. </dataSource>
  783. </chartTextItem>
  784. </chartContents>
  785. </chartLabel>
  786. </chartNodeMember>
  787. -->
  788. <chartTextItem>
  789. <dataSource>
  790. <staticValue>
  791. <xsl:value-of select="$v_currentLevelName"/>
  792. </staticValue>
  793. </dataSource>
  794. </chartTextItem>
  795. </xsl:when>
  796. <xsl:otherwise>
  797. <xsl:apply-templates select="$v_currentChartLevel/baltic:chartText"/>
  798. </xsl:otherwise>
  799. </xsl:choose>
  800. </chartContents>
  801. </chartLabel>
  802. </xsl:if>
  803. <xsl:call-template name="sortListTemplate">
  804. <xsl:with-param name="p_cube" select="$p_cube"/>
  805. <xsl:with-param name="p_refDataItem" select="$v_currentLevelItemRef"/>
  806. <xsl:with-param name="p_base" select="$p_base"/>
  807. </xsl:call-template>
  808. </chartNodeMember>
  809. </chartNodeMembers>
  810. <xsl:variable name="v_nextLevelName" select="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:*[local-name(.)=$p_mode]/baltic:level[position()=$p_pos+1]/@refLevel"/>
  811. <xsl:variable name="v_nextChartLevel" select="$p_base/baltic:chartLevel[@refLevel=$v_nextLevelName]"/>
  812. <xsl:choose>
  813. <xsl:when test="count($v_nextChartLevel) = 1">
  814. <chartNestedNodes>
  815. <xsl:call-template name="chartNodeTemplate">
  816. <xsl:with-param name="p_cube" select="$p_cube"/>
  817. <xsl:with-param name="p_refQuery" select="$p_refQuery"/>
  818. <xsl:with-param name="p_mode" select="$p_mode"/>
  819. <xsl:with-param name="p_base" select="$p_base"/>
  820. <xsl:with-param name="p_addChartContents" select="$p_addChartContents"/>
  821. <xsl:with-param name="p_pos" select="$p_pos+1"/>
  822. <xsl:with-param name="p_checkMeasures" select="$p_checkMeasures"/>
  823. </xsl:call-template>
  824. </chartNestedNodes>
  825. </xsl:when>
  826. <xsl:otherwise>
  827. <xsl:call-template name="chooseEdgeAndPlaceMeasuresTemplate">
  828. <xsl:with-param name="p_mode" select="$p_mode"/>
  829. <xsl:with-param name="p_refQuery" select="$p_refQuery"/>
  830. <xsl:with-param name="p_checkMeasures" select="$v_checkMeasures"/>
  831. <xsl:with-param name="p_cube" select="$p_cube"/>
  832. <xsl:with-param name="p_base" select="$p_base"/>
  833. <xsl:with-param name="p_addNestedNode" select="'true'"/>
  834. </xsl:call-template>
  835. </xsl:otherwise>
  836. </xsl:choose>
  837. </xsl:when>
  838. <xsl:otherwise>
  839. <xsl:call-template name="chooseEdgeAndPlaceMeasuresTemplate">
  840. <xsl:with-param name="p_mode" select="$p_mode"/>
  841. <xsl:with-param name="p_refQuery" select="$p_refQuery"/>
  842. <xsl:with-param name="p_checkMeasures" select="$v_checkMeasures"/>
  843. <xsl:with-param name="p_cube" select="$p_cube"/>
  844. <xsl:with-param name="p_base" select="$p_base"/>
  845. </xsl:call-template>
  846. </xsl:otherwise>
  847. </xsl:choose>
  848. </xsl:when>
  849. <xsl:otherwise>
  850. <!-- Current summary query level not found in the chart. Skip to next level. -->
  851. <chartNodeMembers>
  852. <xsl:variable name="v_nextLevelName" select="//baltic:BIQuery[@name=$p_refQuery]/baltic:summary/baltic:*[local-name(.)=$p_mode]/baltic:level[position()=$p_pos+1]/@refLevel"/>
  853. <xsl:variable name="v_nextChartLevel" select="$p_base/baltic:chartLevel[@refLevel=$v_nextLevelName]"/>
  854. <xsl:if test="count($v_nextChartLevel) = 1">
  855. <xsl:call-template name="chartNodeTemplate">
  856. <xsl:with-param name="p_cube" select="$p_cube"/>
  857. <xsl:with-param name="p_refQuery" select="$p_refQuery"/>
  858. <xsl:with-param name="p_mode" select="$p_mode"/>
  859. <xsl:with-param name="p_base" select="$p_base"/>
  860. <xsl:with-param name="p_addChartContents" select="$p_addChartContents"/>
  861. <xsl:with-param name="p_pos" select="$p_pos+1"/>
  862. <xsl:with-param name="p_checkMeasures" select="$p_checkMeasures"/>
  863. </xsl:call-template>
  864. </xsl:if>
  865. </chartNodeMembers>
  866. </xsl:otherwise>
  867. </xsl:choose>
  868. </xsl:variable>
  869. <xsl:if test="$v_chartNodeContents/*">
  870. <chartNode>
  871. <xsl:copy-of select="$v_chartNodeContents"/>
  872. </chartNode>
  873. </xsl:if>
  874. </xsl:template>
  875. <xsl:template name="standardChartAttributesTemplate">
  876. <!-- refQuery, class, name, repeatEveryPage, showTooltips -->
  877. <!-- refQuery ==> refQuery -->
  878. <xsl:variable name="v_refQuery" select="@refQuery"/>
  879. <xsl:variable name="v_cubeQuery">
  880. <xsl:call-template name="getQueryTemplate">
  881. <xsl:with-param name="refQuery" select="$v_refQuery"/>
  882. </xsl:call-template>
  883. </xsl:variable>
  884. <xsl:attribute name="refQuery"><xsl:value-of select="$v_cubeQuery"/></xsl:attribute>
  885. <!-- originalRefQuery is used when looking up the Baltic query from Bering context, and will be removed in later stages. -->
  886. <xsl:attribute name="originalRefQuery"><xsl:value-of select="$v_refQuery"/></xsl:attribute>
  887. <!-- class ==> class -->
  888. <xsl:variable name="v_default">
  889. <xsl:choose>
  890. <xsl:when test="@class">true</xsl:when>
  891. <xsl:otherwise>false</xsl:otherwise>
  892. </xsl:choose>
  893. </xsl:variable>
  894. <xsl:call-template name="addStyle">
  895. <xsl:with-param name="for" select="'chart'"/>
  896. <xsl:with-param name="default" select="$v_default"/>
  897. </xsl:call-template>
  898. <!-- id ==> name -->
  899. <xsl:variable name="v_id" select="@id"/>
  900. <xsl:if test="$v_id != ''">
  901. <xsl:attribute name="name"><xsl:value-of select="$v_id"/></xsl:attribute>
  902. </xsl:if>
  903. <!-- repeatEveryPage ==> repeatEveryPage -->
  904. <xsl:variable name="v_repeatEveryPage" select="@repeatEveryPage"/>
  905. <xsl:if test="$v_repeatEveryPage != ''">
  906. <xsl:attribute name="repeatEveryPage"><xsl:value-of select="$v_repeatEveryPage"/></xsl:attribute>
  907. </xsl:if>
  908. <!-- tooltips ==> showTooltips -->
  909. <xsl:variable name="v_tooltips" select="@tooltips"/>
  910. <xsl:if test="$v_tooltips != ''">
  911. <xsl:attribute name="showTooltips"><xsl:value-of select="$v_tooltips"/></xsl:attribute>
  912. </xsl:if>
  913. <!-- showValues ==> displayDataLocation -->
  914. <xsl:variable name="v_showValues" select="*[contains(local-name(),'Chart')]/@showValues"/>
  915. <xsl:if test="$v_showValues != ''">
  916. <xsl:call-template name="showValuesToLocationTemplate">
  917. <xsl:with-param name="p_showValues" select="$v_showValues"/>
  918. <xsl:with-param name="p_addShowValuesAttr">
  919. <xsl:choose>
  920. <xsl:when test="*[contains(local-name(),'radarChart')]">true</xsl:when>
  921. <xsl:when test="*[contains(local-name(),'progressiveChart')]">true</xsl:when>
  922. <xsl:when test="*[contains(local-name(),'paretoChart')]">true</xsl:when>
  923. <xsl:otherwise>false</xsl:otherwise>
  924. </xsl:choose>
  925. </xsl:with-param>
  926. </xsl:call-template>
  927. </xsl:if>
  928. </xsl:template>
  929. <xsl:template name="commonChartTemplate">
  930. <xsl:apply-templates select="baltic:title"/>
  931. <xsl:apply-templates select="baltic:subtitle"/>
  932. <xsl:apply-templates select="baltic:footer"/>
  933. <xsl:apply-templates select="baltic:chartBody/baltic:chartPalette"/>
  934. <xsl:variable name="v_CSS">
  935. <xsl:call-template name="widthAndHeightTemplate"/>
  936. </xsl:variable>
  937. <xsl:choose>
  938. <xsl:when test="baltic:style">
  939. <xsl:apply-templates select="baltic:style">
  940. <xsl:with-param name="p_addValue" select="$v_CSS"/>
  941. </xsl:apply-templates>
  942. </xsl:when>
  943. <xsl:otherwise>
  944. <xsl:if test="$v_CSS != ''">
  945. <style>
  946. <CSS value="{$v_CSS}"/>
  947. </style>
  948. </xsl:if>
  949. </xsl:otherwise>
  950. </xsl:choose>
  951. <xsl:apply-templates select="baltic:conditionalStyle"/>
  952. <xsl:apply-templates select="baltic:chartBody"/>
  953. <xsl:apply-templates select="baltic:background"/>
  954. <xsl:if test="baltic:note">
  955. <notes>
  956. <xsl:apply-templates select="baltic:note"/>
  957. </notes>
  958. </xsl:if>
  959. <xsl:call-template name="drillTargetTemplate"/>
  960. </xsl:template>
  961. <xsl:template name="checkSummaryLevelTemplate">
  962. <xsl:param name="p_mode"/>
  963. <xsl:param name="p_base" select="."/>
  964. <xsl:variable name="v_refQuery" select="@refQuery"/>
  965. <xsl:for-each select="$p_base/baltic:chartLevel">
  966. <xsl:variable name="v_refDataItem" select="baltic:queryItemRef/@refItem"/>
  967. <xsl:if test="//baltic:BIQuery[@name=$v_refQuery]/baltic:summary/baltic:*[local-name(.)=$p_mode]/baltic:level/baltic:item[@refItem=$v_refDataItem]">
  968. <xsl:text>true</xsl:text>
  969. </xsl:if>
  970. </xsl:for-each>
  971. </xsl:template>
  972. <xsl:template name="processAttsTemplate">
  973. <xsl:param name="p_cur" select="."/>
  974. <xsl:variable name="v_showValues" select="$p_cur/@showValues"/>
  975. <xsl:if test="$v_showValues != '' and $v_showValues != 'none'">
  976. <xsl:attribute name="showValues">true</xsl:attribute>
  977. <xsl:variable name="v_showValuesLocation" select="$p_cur/@showValues"/>
  978. <xsl:if test="$v_showValuesLocation != ''">
  979. <xsl:call-template name="showValuesToLocationTemplate">
  980. <xsl:with-param name="p_showValues" select="$v_showValuesLocation"/>
  981. <xsl:with-param name="p_addShowValuesAttr" select="'false'"/>
  982. </xsl:call-template>
  983. </xsl:if>
  984. </xsl:if>
  985. </xsl:template>
  986. <xsl:template name="dataPointTemplate">
  987. <xsl:variable name="v_dataPointShape">
  988. <xsl:choose>
  989. <!-- WO1194: piratePlus has been removed as an available marker. Replace with fatPlus. -->
  990. <xsl:when test="@markerShape = 'piratePlus'">fatPlus</xsl:when>
  991. <xsl:when test="@markerShape">
  992. <xsl:value-of select="@markerShape"/>
  993. </xsl:when>
  994. <xsl:otherwise>plainX</xsl:otherwise>
  995. </xsl:choose>
  996. </xsl:variable>
  997. <xsl:attribute name="dataPointShape"><xsl:value-of select="$v_dataPointShape"/></xsl:attribute>
  998. <!-- Note: markerSize is in pixels and must be converted to points for dataPointSize (see Trakker 550271). -->
  999. <xsl:attribute name="dataPointSize"><xsl:choose><xsl:when test="@markerSize"><xsl:value-of select="@markerSize * 0.75"/></xsl:when><xsl:otherwise>5</xsl:otherwise></xsl:choose></xsl:attribute>
  1000. </xsl:template>
  1001. <xsl:template name="chartMarkerTemplate">
  1002. <xsl:param name="p_chart" select="."/>
  1003. <xsl:param name="p_defaultShape" select="'circle'"/>
  1004. <xsl:param name="p_addDataPointSize"/>
  1005. <xsl:choose>
  1006. <xsl:when test="$p_chart/@depth &gt; 0">
  1007. <!-- See trakker 544100 and 540948. A Baltic but would not output markers if the depth was not zero.
  1008. * Since we are in the middle of an element we cannot output the diagnostic into the XML.
  1009. -->
  1010. <!-- Gotcha, markers will be generated unless the dataPointSize is set to 0. -->
  1011. <xsl:attribute name="dataPointSize">0</xsl:attribute>
  1012. <xsl:value-of select="log:logInfo0Void(/baltic:report/logIdentifier/@logId, 'RSU_SPC_DEPTH_OVERRIDES_MARKER')" xmlns:log="http://developer.cognos.com/schemas/report/2.0/com.cognos.rspecupgrade.rsupgrade.internal.upgradepipeline.tools.LogMap"/>
  1013. </xsl:when>
  1014. <xsl:otherwise>
  1015. <xsl:attribute name="pointChartDataPointShape"><xsl:call-template name="chartMarker"><xsl:with-param name="p_chart" select="$p_chart"/><xsl:with-param name="p_defaultShape" select="$p_defaultShape"/></xsl:call-template></xsl:attribute>
  1016. <xsl:if test="$p_addDataPointSize != 'false'">
  1017. <!-- Note: markerSize is in pixels and must be converted to points for dataPointSize (see Trakker 550271). -->
  1018. <xsl:attribute name="dataPointSize"><xsl:choose><xsl:when test="$p_chart/@markerSize != ''"><xsl:value-of select="$p_chart/@markerSize * 0.75"/></xsl:when><xsl:otherwise>5</xsl:otherwise></xsl:choose></xsl:attribute>
  1019. </xsl:if>
  1020. </xsl:otherwise>
  1021. </xsl:choose>
  1022. </xsl:template>
  1023. <!--
  1024. * WO1194: piratePlus has been removed as an available marker. Replace with fatPlus.
  1025. * Since we are in the middle of an element we cannot output the diagnostic into the XML.
  1026. -->
  1027. <xsl:template name="chartMarker">
  1028. <xsl:param name="p_chart"/>
  1029. <xsl:param name="p_defaultShape" select="'circle'"/>
  1030. <xsl:choose>
  1031. <!-- WO1194: piratePlus has been removed as an available marker. Replace with fatPlus. -->
  1032. <xsl:when test="$p_chart/@markerShape = 'piratePlus'">
  1033. <xsl:value-of select="log:logInfo2Void(/baltic:report/logIdentifier/@logId, 'RSU_SPC_OBSOLETE_MARKER', 'piratePlus', 'fatPlus')" xmlns:log="http://developer.cognos.com/schemas/report/2.0/com.cognos.rspecupgrade.rsupgrade.internal.upgradepipeline.tools.LogMap"/>
  1034. fatPlus
  1035. </xsl:when>
  1036. <xsl:when test="$p_chart/@markerShape != ''">
  1037. <xsl:value-of select="$p_chart/@markerShape"/>
  1038. </xsl:when>
  1039. <xsl:otherwise>
  1040. <xsl:value-of select="$p_defaultShape"/>
  1041. </xsl:otherwise>
  1042. </xsl:choose>
  1043. </xsl:template>
  1044. <!--
  1045. *
  1046. -->
  1047. <xsl:template name="widthAndHeightTemplate">
  1048. <xsl:variable name="v_chartWidth" select="@chartWidth"/>
  1049. <xsl:variable name="v_chartHeight" select="@chartHeight"/>
  1050. <xsl:if test="$v_chartWidth != ''">
  1051. <xsl:text>width:</xsl:text>
  1052. <xsl:value-of select="$v_chartWidth"/>
  1053. <xsl:text>px;</xsl:text>
  1054. </xsl:if>
  1055. <xsl:if test="$v_chartHeight != ''">
  1056. <xsl:text>height:</xsl:text>
  1057. <xsl:value-of select="$v_chartHeight"/>
  1058. <xsl:text>px;</xsl:text>
  1059. </xsl:if>
  1060. </xsl:template>
  1061. <xsl:template name="quadrantLineTemplate">
  1062. <xsl:param name="axisPosition"/>
  1063. <xsl:param name="percentAlongAxis"/>
  1064. <xsl:element name="pointChartBaseline">
  1065. <xsl:attribute name="pointChartAxis"><xsl:choose><xsl:when test="$axisPosition = 'xPosition'"><xsl:text>xAxis</xsl:text></xsl:when><xsl:otherwise><xsl:text>yAxis</xsl:text></xsl:otherwise></xsl:choose></xsl:attribute>
  1066. <xsl:element name="pointChartBaselinePosition">
  1067. <xsl:element name="percentAlongAxis">
  1068. <xsl:attribute name="percentAlongAxis"><xsl:choose><xsl:when test="$percentAlongAxis != ''"><xsl:value-of select="$percentAlongAxis"/></xsl:when><xsl:otherwise><!--Carry the default value from V4 to V5--><xsl:text>50</xsl:text></xsl:otherwise></xsl:choose></xsl:attribute>
  1069. </xsl:element>
  1070. </xsl:element>
  1071. </xsl:element>
  1072. </xsl:template>
  1073. <xsl:template name="sortListTemplate">
  1074. <xsl:param name="p_cube"/>
  1075. <xsl:param name="p_refDataItem"/>
  1076. <xsl:param name="p_base"/>
  1077. <!-- Generate sortList from the baltic:item sort attributes up to this level in the current dimension.
  1078. * Beware: some additional stages will clean up this. In particular sortItems may be duplicated, and the sortOrder may
  1079. * be invalid, waiting to be set from the tabular model.
  1080. -->
  1081. <sortList>
  1082. <xsl:choose>
  1083. <xsl:when test="$p_cube//baltic:item[@alias=$p_refDataItem]">
  1084. <!-- Items in preceding levels. -->
  1085. <xsl:apply-templates select="$p_cube//baltic:level/baltic:item[@alias=$p_refDataItem]/../preceding-sibling::baltic:level/baltic:item" mode="generate_sortItems"/>
  1086. <!-- All items in same level.-->
  1087. <xsl:apply-templates select="$p_cube//baltic:level/baltic:item[@alias=$p_refDataItem]/../baltic:item" mode="generate_sortItems"/>
  1088. <!-- Named item in factList. -->
  1089. <xsl:apply-templates select="$p_cube/baltic:factList/baltic:item[@alias=$p_refDataItem]" mode="generate_sortItems"/>
  1090. </xsl:when>
  1091. <xsl:when test="$p_cube//baltic:item[@refItem=$p_refDataItem]">
  1092. <!-- Items in preceding levels. -->
  1093. <xsl:apply-templates select="$p_cube//baltic:level/baltic:item[@refItem=$p_refDataItem]/../preceding-sibling::baltic:level/baltic:item" mode="generate_sortItems"/>
  1094. <!-- All items in same level.-->
  1095. <xsl:apply-templates select="$p_cube//baltic:level/baltic:item[@refItem=$p_refDataItem]/../baltic:item" mode="generate_sortItems"/>
  1096. <!-- Named item in factList. -->
  1097. <xsl:apply-templates select="$p_cube/baltic:factList/baltic:item[@refItem=$p_refDataItem]" mode="generate_sortItems"/>
  1098. </xsl:when>
  1099. </xsl:choose>
  1100. <!-- Measures that sort chart node members.
  1101. * If the chart node members were unsorted, then we are
  1102. * allowed to change the sort order. If they were sorted,
  1103. * the new sorting item is added afterwards and will only be
  1104. * used in ties.
  1105. -->
  1106. <xsl:for-each select="$p_base">
  1107. <xsl:for-each select="baltic:chartMeasure/baltic:member">
  1108. <xsl:variable name="v_refMember" select="@refMember"/>
  1109. <xsl:choose>
  1110. <xsl:when test="$p_cube/baltic:factList/baltic:item[@alias=$v_refMember]">
  1111. <xsl:apply-templates select="$p_cube/baltic:factList/baltic:item[@alias=$v_refMember]" mode="generate_sortItems"/>
  1112. </xsl:when>
  1113. <xsl:when test="$p_cube/baltic:factList/baltic:item[@refItem=$v_refMember]">
  1114. <xsl:apply-templates select="$p_cube/baltic:factList/baltic:item[@refItem=$v_refMember]" mode="generate_sortItems"/>
  1115. </xsl:when>
  1116. </xsl:choose>
  1117. </xsl:for-each>
  1118. </xsl:for-each>
  1119. <xsl:choose>
  1120. <xsl:when test="count($p_base/baltic:chartLevel) = 1 and count($p_base/baltic:chartMeasure) = 1">
  1121. <xsl:variable name="v_refDataItem">
  1122. <xsl:choose>
  1123. <xsl:when test="$p_base/baltic:chartMeasure/baltic:chartText/baltic:queryItemRef/@refItem">
  1124. <xsl:value-of select="$p_base/baltic:chartMeasure/baltic:chartText/baltic:queryItemRef/@refItem"/>
  1125. </xsl:when>
  1126. <xsl:when test="$p_base/baltic:chartMeasure/baltic:member/@refMember">
  1127. <xsl:value-of select="$p_base/baltic:chartMeasure/baltic:member/@refMember"/>
  1128. </xsl:when>
  1129. </xsl:choose>
  1130. </xsl:variable>
  1131. <xsl:apply-templates select="$p_cube//baltic:item[@refItem=$v_refDataItem]/../preceding-sibling::baltic:level//baltic:item" mode="generate_sortItems"/>
  1132. <xsl:apply-templates select="$p_cube//baltic:item[@refItem=$v_refDataItem]" mode="generate_sortItems"/>
  1133. </xsl:when>
  1134. </xsl:choose>
  1135. </sortList>
  1136. </xsl:template>
  1137. <xsl:template name="lineStyleTemplate">
  1138. <xsl:param name="p_lineStyle" select="@lineStyle"/>
  1139. <xsl:if test="$p_lineStyle != ''">
  1140. <xsl:attribute name="lineStyle"><xsl:value-of select="translate($p_lineStyle,'ABCDEFGHIJKLMNOPQRSTVWXYZ','abcdefghijklmnopqrstvwxyz')"/></xsl:attribute>
  1141. </xsl:if>
  1142. </xsl:template>
  1143. <xsl:template name="processChartMeasuresTemplate">
  1144. <xsl:param name="p_cube"/>
  1145. <xsl:param name="p_base"/>
  1146. <xsl:for-each select="$p_base/baltic:chartMeasure">
  1147. <xsl:variable name="v_refDataItem" select="baltic:member/@refMember"/>
  1148. <chartNodeMember refDataItem="{$v_refDataItem}">
  1149. <chartContents>
  1150. <chartTextItem>
  1151. <dataSource>
  1152. <xsl:choose>
  1153. <xsl:when test="baltic:chartText/baltic:text">
  1154. <xsl:element name="staticValue">
  1155. <xsl:value-of select="baltic:chartText/baltic:text/text()"/>
  1156. </xsl:element>
  1157. </xsl:when>
  1158. <xsl:otherwise>
  1159. <memberCaption/>
  1160. </xsl:otherwise>
  1161. </xsl:choose>
  1162. </dataSource>
  1163. </chartTextItem>
  1164. </chartContents>
  1165. <xsl:call-template name="mergeStylesFromChartBodyAndChartMeasure">
  1166. <xsl:with-param name="p_chartBody" select="$p_base/baltic:chartBody"/>
  1167. <xsl:with-param name="p_chartMeasure" select="."/>
  1168. </xsl:call-template>
  1169. <xsl:call-template name="sortListTemplate">
  1170. <xsl:with-param name="p_cube" select="$p_cube"/>
  1171. <xsl:with-param name="p_refDataItem" select="$v_refDataItem"/>
  1172. <xsl:with-param name="p_base" select="$p_base"/>
  1173. </xsl:call-template>
  1174. </chartNodeMember>
  1175. </xsl:for-each>
  1176. </xsl:template>
  1177. <xsl:template name="showValuesToLocationTemplate">
  1178. <xsl:param name="p_showValues"/>
  1179. <xsl:param name="p_addShowValuesAttr" select="'false'"/>
  1180. <xsl:variable name="v_displayDataLocation">
  1181. <xsl:choose>
  1182. <xsl:when test="$p_showValues = 'insideMaximum'">insideAtTop</xsl:when>
  1183. <xsl:when test="$p_showValues = 'outsideMaximum'">outsideAtTop</xsl:when>
  1184. <xsl:when test="$p_showValues = 'insideMinimum'">insideAtBottom</xsl:when>
  1185. <xsl:when test="$p_showValues = 'outsideMinimum'">outsideAtBottom</xsl:when>
  1186. <xsl:when test="$p_showValues = 'center'">centered</xsl:when>
  1187. <xsl:when test="$p_showValues = 'none'"/>
  1188. </xsl:choose>
  1189. </xsl:variable>
  1190. <xsl:if test="$v_displayDataLocation != ''">
  1191. <xsl:if test="$p_addShowValuesAttr = 'true'">
  1192. <xsl:attribute name="showValues">true</xsl:attribute>
  1193. </xsl:if>
  1194. <xsl:attribute name="displayDataLocation"><xsl:value-of select="$v_displayDataLocation"/></xsl:attribute>
  1195. </xsl:if>
  1196. </xsl:template>
  1197. <xsl:template name="pointsAndPointClustersTemplate">
  1198. <xsl:param name="p_radialClusters"/>
  1199. <xsl:param name="p_checkMeasures" select="'never'"/>
  1200. <xsl:variable name="v_points">
  1201. <xsl:call-template name="chartLevelTemplate">
  1202. <xsl:with-param name="p_mode" select="'rowEdge'"/>
  1203. <xsl:with-param name="p_checkMeasures" select="$p_checkMeasures"/>
  1204. </xsl:call-template>
  1205. </xsl:variable>
  1206. <xsl:variable name="v_pointClusters">
  1207. <xsl:call-template name="chartLevelTemplate">
  1208. <xsl:with-param name="p_mode" select="'columnEdge'"/>
  1209. <xsl:with-param name="p_checkMeasures" select="$p_checkMeasures"/>
  1210. </xsl:call-template>
  1211. </xsl:variable>
  1212. <xsl:choose>
  1213. <xsl:when test="$v_points//*">
  1214. <points>
  1215. <xsl:copy-of select="$v_points"/>
  1216. </points>
  1217. <xsl:choose>
  1218. <xsl:when test="$p_radialClusters = 'true'">
  1219. <xsl:if test="$v_pointClusters//*">
  1220. <radialClusters>
  1221. <xsl:copy-of select="$v_pointClusters"/>
  1222. </radialClusters>
  1223. </xsl:if>
  1224. </xsl:when>
  1225. <xsl:otherwise>
  1226. <xsl:if test="$v_pointClusters//*">
  1227. <pointClusters>
  1228. <xsl:copy-of select="$v_pointClusters"/>
  1229. </pointClusters>
  1230. </xsl:if>
  1231. </xsl:otherwise>
  1232. </xsl:choose>
  1233. </xsl:when>
  1234. <xsl:otherwise>
  1235. <xsl:if test="$v_pointClusters//*">
  1236. <points>
  1237. <xsl:copy-of select="$v_pointClusters"/>
  1238. </points>
  1239. </xsl:if>
  1240. </xsl:otherwise>
  1241. </xsl:choose>
  1242. </xsl:template>
  1243. <xsl:template match="baltic:title">
  1244. <xsl:variable name="v_chartTitle">
  1245. <xsl:choose>
  1246. <xsl:when test="baltic:text">
  1247. <xsl:value-of select="baltic:text"/>
  1248. </xsl:when>
  1249. <xsl:when test="baltic:queryItemRef">'true'</xsl:when>
  1250. <xsl:when test="baltic:expression">'true'</xsl:when>
  1251. <xsl:otherwise/>
  1252. </xsl:choose>
  1253. </xsl:variable>
  1254. <xsl:if test="$v_chartTitle != ''">
  1255. <chartTitle>
  1256. <xsl:call-template name="addStyle">
  1257. <xsl:with-param name="for" select="'chartTitle'"/>
  1258. </xsl:call-template>
  1259. <chartContents>
  1260. <xsl:call-template name="chartTextTemplate"/>
  1261. </chartContents>
  1262. <xsl:if test="@render = 'false'">
  1263. <style>
  1264. <CSS value="visibility:hidden"/>
  1265. </style>
  1266. </xsl:if>
  1267. <xsl:if test="@render != 'false'">
  1268. <xsl:call-template name="simpleLayoutGroupTemplate">
  1269. <xsl:with-param name="p_cur" select="."/>
  1270. </xsl:call-template>
  1271. </xsl:if>
  1272. </chartTitle>
  1273. </xsl:if>
  1274. </xsl:template>
  1275. <xsl:template match="baltic:title" mode="legend">
  1276. <xsl:call-template name="chartTextTemplate"/>
  1277. </xsl:template>
  1278. <xsl:template match="baltic:title" mode="axis">
  1279. <xsl:call-template name="chartTextTemplate"/>
  1280. </xsl:template>
  1281. <xsl:template match="baltic:subtitle">
  1282. <xsl:variable name="v_chartSubTitle">
  1283. <xsl:choose>
  1284. <xsl:when test="baltic:text">
  1285. <xsl:value-of select="baltic:text"/>
  1286. </xsl:when>
  1287. <xsl:when test="baltic:queryItemRef">'true'</xsl:when>
  1288. <xsl:when test="baltic:expression">'true'</xsl:when>
  1289. <xsl:otherwise/>
  1290. </xsl:choose>
  1291. </xsl:variable>
  1292. <xsl:if test="$v_chartSubTitle != ''">
  1293. <chartSubTitle>
  1294. <xsl:call-template name="addStyle">
  1295. <xsl:with-param name="for" select="'chartSubtitle'"/>
  1296. </xsl:call-template>
  1297. <chartContents>
  1298. <xsl:call-template name="chartTextTemplate"/>
  1299. </chartContents>
  1300. <xsl:if test="@render = 'false'">
  1301. <style>
  1302. <CSS value="visibility:hidden"/>
  1303. </style>
  1304. </xsl:if>
  1305. <xsl:if test="@render != 'false'">
  1306. <xsl:call-template name="simpleLayoutGroupTemplate">
  1307. <xsl:with-param name="p_cur" select="."/>
  1308. </xsl:call-template>
  1309. </xsl:if>
  1310. </chartSubTitle>
  1311. </xsl:if>
  1312. </xsl:template>
  1313. <xsl:template match="baltic:footer">
  1314. <xsl:variable name="v_chartFooter">
  1315. <xsl:choose>
  1316. <xsl:when test="baltic:text">
  1317. <xsl:value-of select="baltic:text"/>
  1318. </xsl:when>
  1319. <xsl:when test="baltic:queryItemRef">'true'</xsl:when>
  1320. <xsl:when test="baltic:expression">'true'</xsl:when>
  1321. <xsl:otherwise/>
  1322. </xsl:choose>
  1323. </xsl:variable>
  1324. <xsl:if test="$v_chartFooter != ''">
  1325. <chartFooter>
  1326. <xsl:call-template name="addStyle">
  1327. <xsl:with-param name="for" select="'chartFooter'"/>
  1328. </xsl:call-template>
  1329. <chartContents>
  1330. <xsl:call-template name="chartTextTemplate"/>
  1331. </chartContents>
  1332. <xsl:if test="@render = 'false'">
  1333. <style>
  1334. <CSS value="visibility:hidden"/>
  1335. </style>
  1336. </xsl:if>
  1337. <xsl:if test="@render != 'false'">
  1338. <xsl:call-template name="simpleLayoutGroupTemplate">
  1339. <xsl:with-param name="p_cur" select="."/>
  1340. </xsl:call-template>
  1341. </xsl:if>
  1342. </chartFooter>
  1343. </xsl:if>
  1344. </xsl:template>
  1345. <xsl:template name="depthTemplate">
  1346. <xsl:param name="p_defaultDepth" select="'50'"/>
  1347. <xsl:variable name="v_depth">
  1348. <xsl:call-template name="getChartDepth"/>
  1349. </xsl:variable>
  1350. <xsl:attribute name="depth"><xsl:choose><xsl:when test="$v_depth != ''"><xsl:value-of select="$v_depth"/></xsl:when><xsl:otherwise><xsl:value-of select="$p_defaultDepth"/></xsl:otherwise></xsl:choose></xsl:attribute>
  1351. </xsl:template>
  1352. <xsl:template name="getChartDepth">
  1353. <xsl:value-of select="*[contains(local-name(), 'Chart')]/@depth"/>
  1354. </xsl:template>
  1355. <xsl:template name="pointChartShowValuesTemplate">
  1356. <xsl:if test="*[contains(local-name(),'Chart')]/@showValues">
  1357. <xsl:attribute name="showPointValues">valuesAndLabels</xsl:attribute>
  1358. </xsl:if>
  1359. <xsl:if test="*[contains(local-name(),'Chart')]/@showLabels">
  1360. <xsl:attribute name="showPointValuesForPoints">valuesOnly</xsl:attribute>
  1361. </xsl:if>
  1362. </xsl:template>
  1363. <xsl:template name="getColorFromCSSTemplate">
  1364. <xsl:param name="inputString"/>
  1365. <xsl:param name="color"/>
  1366. <xsl:choose>
  1367. <xsl:when test="starts-with($inputString, 'color:')">
  1368. <xsl:variable name="tempString" select="substring-after($inputString, 'color:')"/>
  1369. <xsl:choose>
  1370. <xsl:when test="contains($tempString, ';')">
  1371. <xsl:call-template name="getColorFromCSSTemplate">
  1372. <xsl:with-param name="inputString" select="substring-after($tempString, ';')"/>
  1373. <xsl:with-param name="color" select="substring-before($tempString, ';')"/>
  1374. </xsl:call-template>
  1375. </xsl:when>
  1376. <xsl:otherwise>
  1377. <xsl:value-of select="$tempString"/>
  1378. </xsl:otherwise>
  1379. </xsl:choose>
  1380. </xsl:when>
  1381. <xsl:when test="contains($inputString, ';')">
  1382. <xsl:call-template name="getColorFromCSSTemplate">
  1383. <xsl:with-param name="inputString" select="substring-after($inputString, ';')"/>
  1384. <xsl:with-param name="color" select="$color"/>
  1385. </xsl:call-template>
  1386. </xsl:when>
  1387. <xsl:otherwise>
  1388. <xsl:value-of select="$color"/>
  1389. </xsl:otherwise>
  1390. </xsl:choose>
  1391. </xsl:template>
  1392. <!--
  1393. * Output the ordinalAxis
  1394. * @param p_gridlines Should gridlines be generated. 0 is false, 1 is true.
  1395. -->
  1396. <xsl:template name="ordinalAxis">
  1397. <xsl:param name="p_gridLines"/>
  1398. <ordinalAxis>
  1399. <xsl:call-template name="copyTruncationAttsTemplate"/>
  1400. <xsl:call-template name="processAllowAttsTemplate">
  1401. <xsl:with-param name="p_el" select=".."/>
  1402. </xsl:call-template>
  1403. <xsl:call-template name="axisTitleTemplate"/>
  1404. <xsl:if test="$p_gridLines">
  1405. <xsl:call-template name="gridlinesTemplate">
  1406. <xsl:with-param name="p_chart" select=".."/>
  1407. <xsl:with-param name="p_mandatory" select="'true'"/>
  1408. </xsl:call-template>
  1409. </xsl:if>
  1410. <xsl:call-template name="mergeStylesFromAxisAndAxisLabelsTemplate"/>
  1411. <xsl:apply-templates select="baltic:labels/baltic:conditionalStyle"/>
  1412. </ordinalAxis>
  1413. </xsl:template>
  1414. </xsl:stylesheet>