RSUpgradeList.xsl 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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:list">
  13. <list>
  14. <xsl:variable name="var_refQuery" select="@refQuery"/>
  15. <!-- originalRefQuery is used for property list fixups, and will be removed in later stages. -->
  16. <xsl:attribute name="originalRefQuery"><xsl:value-of select="@refQuery"/></xsl:attribute>
  17. <xsl:call-template name="listAttributesTemplate"/>
  18. <!--
  19. * In baltic, the list columns and their titles are specified separately.
  20. * In bering, each column specification contains its title.
  21. * So we must gather both columns and titles before generating the bering listColumns:
  22. *
  23. * list/listColumns/listColumn -> list/listColumns/listColumn/listColumnBody
  24. * list/listColumnTitles/listColumnTitle - > list/listColumns/listColumn/listColumnTitle
  25. *
  26. * Mappings for the other list elements:
  27. *
  28. * list/overallHeader -> list/listOverallGroup/listHeader
  29. * list/overallFooter -> list/listOverallGroup/listFooter
  30. * list/listHeader -> list/listPageHeader
  31. * list/listFooter -> list/listPageFooter
  32. * list/groupHeader -> list/listGroups/listGroup/listHeader
  33. * list/groupFooter -> list/listGroups/listGroup/listFooter
  34. *
  35. * Mappings for corresponding list styles:
  36. *
  37. * list/overallHeader/rowCells/simpleLayoutGroup -> list/listOverallGroup/listHeader/rowCellsStyle
  38. * list/overallFooter/rowCells/simpleLayoutGroup -> list/listOverallGroup/listFooter/rowCellsStyle
  39. * list/listHeader/rowCells/simpleLayoutGroup -> list/listPageHeader/rowCellsStyle.
  40. * list/listFooter/rowCells/simpleLayoutGroup -> list/listPageFooter/rowCellsStyle.
  41. * list/groupHeader/rowCells/simpleLayoutGroup -> list/listGroups/listGroup/listHeader/rowCellsStyle
  42. * list/groupFooter/rowCells/simpleLayoutGroup -> list/listGroups/listGroup/listFooter/rowCellsStyle
  43. * list/listColumnTitles/simpleLayoutGroup -> list/listColumnTitleStyle
  44. * list/listColumns/simpleLayoutGroup -> list/listColumnBodyStyle
  45. *
  46. -->
  47. <xsl:call-template name="generateMasterDetailLinks2">
  48. <xsl:with-param name="p_frame" select="."/>
  49. </xsl:call-template>
  50. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  51. <xsl:variable name="var_nColumnBodies" select="count(baltic:listColumns/baltic:listColumn)"/>
  52. <xsl:variable name="var_nColumnTitles" select="count(baltic:listColumnTitles/baltic:listColumnTitle)"/>
  53. <xsl:variable name="var_listColumns" select="baltic:listColumns/baltic:listColumn"/>
  54. <xsl:variable name="var_listColumnTitles" select="baltic:listColumnTitles/baltic:listColumnTitle"/>
  55. <xsl:choose>
  56. <xsl:when test="$var_nColumnBodies = 0 and $var_nColumnTitles = 0">
  57. <xsl:comment>This list has no columns.</xsl:comment>
  58. </xsl:when>
  59. <xsl:when test="$var_nColumnBodies &gt; $var_nColumnTitles">
  60. <listColumns>
  61. <xsl:for-each select="baltic:listColumns/baltic:listColumn">
  62. <listColumn>
  63. <xsl:variable name="var_position" select="position()"/>
  64. <xsl:choose>
  65. <xsl:when test="$var_position &lt;= $var_nColumnTitles">
  66. <xsl:apply-templates select="$var_listColumnTitles[$var_position]"/>
  67. </xsl:when>
  68. <xsl:otherwise>
  69. <listColumnTitle>
  70. <contents/>
  71. </listColumnTitle>
  72. </xsl:otherwise>
  73. </xsl:choose>
  74. <xsl:apply-templates select="$var_listColumns[$var_position]"/>
  75. </listColumn>
  76. </xsl:for-each>
  77. </listColumns>
  78. </xsl:when>
  79. <xsl:otherwise>
  80. <listColumns>
  81. <xsl:for-each select="baltic:listColumnTitles/baltic:listColumnTitle">
  82. <listColumn>
  83. <xsl:variable name="var_position" select="position()"/>
  84. <xsl:apply-templates select="$var_listColumnTitles[$var_position]"/>
  85. <xsl:choose>
  86. <xsl:when test="$var_position &lt;= $var_nColumnBodies">
  87. <xsl:apply-templates select="$var_listColumns[$var_position]"/>
  88. </xsl:when>
  89. <xsl:otherwise>
  90. <listColumnBody>
  91. <contents/>
  92. </listColumnBody>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </listColumn>
  96. </xsl:for-each>
  97. </listColumns>
  98. </xsl:otherwise>
  99. </xsl:choose>
  100. <!-- The structure of the V5 list grouping is derived from the V4 Cube Dimension Levels. -->
  101. <xsl:apply-templates select="/baltic:report/baltic:querySet/baltic:BIQuery[@name=$var_refQuery]" mode="list">
  102. <xsl:with-param name="p_list" select="."/>
  103. </xsl:apply-templates>
  104. <xsl:call-template name="baltic:listOverallGroupTemplate"/>
  105. <xsl:apply-templates select="baltic:listHeader"/>
  106. <xsl:apply-templates select="baltic:listFooter"/>
  107. <xsl:apply-templates select="baltic:listColumnTitles" mode="style"/>
  108. <xsl:apply-templates select="baltic:listColumns" mode="style"/>
  109. </list>
  110. </xsl:template>
  111. <xsl:template name="listAttributesTemplate">
  112. <xsl:call-template name="addStyle"/>
  113. <xsl:attribute name="refQuery"><xsl:call-template name="getQueryTemplate"><xsl:with-param name="refQuery" select="@refQuery"/></xsl:call-template></xsl:attribute>
  114. <xsl:if test="count(@id) = 1">
  115. <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
  116. </xsl:if>
  117. <xsl:if test="count(@maxColumns) = 1">
  118. <xsl:attribute name="columnsPerPage"><xsl:value-of select="@maxColumns"/></xsl:attribute>
  119. </xsl:if>
  120. <xsl:if test="@maxRows != ''">
  121. <xsl:choose>
  122. <xsl:when test="@maxRows=0">
  123. <!-- INFINITY -->
  124. <xsl:attribute name="rowsPerPage">2147483647</xsl:attribute>
  125. </xsl:when>
  126. <xsl:when test="@maxRows&gt;0">
  127. <xsl:attribute name="rowsPerPage"><xsl:value-of select="@maxRows"/></xsl:attribute>
  128. </xsl:when>
  129. </xsl:choose>
  130. </xsl:if>
  131. <xsl:if test="count(@cellHeightBehavior) = 1">
  132. <xsl:attribute name="cellHeightBehavior"><xsl:value-of select="@cellHeightBehavior"/></xsl:attribute>
  133. </xsl:if>
  134. <xsl:if test="count(@showColumnTitles) = 1">
  135. <xsl:attribute name="showColumnTitles"><xsl:value-of select="@showColumnTitles"/></xsl:attribute>
  136. </xsl:if>
  137. <xsl:if test="count(@repeatEveryPage) = 1">
  138. <xsl:attribute name="repeatEveryPage"><xsl:value-of select="@repeatEveryPage"/></xsl:attribute>
  139. </xsl:if>
  140. <xsl:if test="count(@keepWithHeader) = 1">
  141. <xsl:attribute name="keepWithHeader"><xsl:choose><xsl:when test="@keepWithHeader = 'true'">1</xsl:when><xsl:when test="@keepWithHeader = 'false'">0</xsl:when><xsl:otherwise><xsl:value-of select="@keepWithHeader"/></xsl:otherwise></xsl:choose></xsl:attribute>
  142. </xsl:if>
  143. <xsl:if test="count(@keepWithFooter) = 1">
  144. <xsl:attribute name="keepWithFooter"><xsl:choose><xsl:when test="@keepWithFooter = 'true'">1</xsl:when><xsl:when test="@keepWithFooter = 'false'">0</xsl:when><xsl:otherwise><xsl:value-of select="@keepWithFooter"/></xsl:otherwise></xsl:choose></xsl:attribute>
  145. </xsl:if>
  146. <xsl:if test="count(@shareResultSet) = 1">
  147. <xsl:attribute name="shareResultSet"><xsl:value-of select="@shareResultSet"/></xsl:attribute>
  148. </xsl:if>
  149. </xsl:template>
  150. <xsl:template match="baltic:listColumnTitles" mode="style">
  151. <xsl:if test="count(baltic:style) &gt; 0 or count(baltic:XMLAttribute) &gt; 0 or
  152. count(baltic:conditionalStyle) &gt; 0">
  153. <listColumnTitleStyle>
  154. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  155. </listColumnTitleStyle>
  156. </xsl:if>
  157. </xsl:template>
  158. <xsl:template match="baltic:listColumns" mode="style">
  159. <xsl:if test="count(baltic:style) &gt; 0 or count(baltic:XMLAttribute) &gt; 0 or
  160. count(baltic:conditionalStyle) &gt; 0">
  161. <listColumnBodyStyle>
  162. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  163. </listColumnBodyStyle>
  164. </xsl:if>
  165. </xsl:template>
  166. <xsl:template match="baltic:listColumnTitle">
  167. <listColumnTitle>
  168. <xsl:call-template name="addStyle"/>
  169. <xsl:call-template name="layoutContainerTemplate"/>
  170. </listColumnTitle>
  171. </xsl:template>
  172. <xsl:template match="baltic:listColumn">
  173. <listColumnBody>
  174. <xsl:call-template name="addStyle"/>
  175. <xsl:call-template name="layoutContainerTemplate"/>
  176. <!-- Map @refLevel to listColumnRowSpan/@refDataItem. -->
  177. <xsl:if test="count(@refLevel) = 1">
  178. <xsl:variable name="v_refQuery" select="ancestor::baltic:list[1]/@refQuery"/>
  179. <xsl:variable name="v_refLevel" select="@refLevel"/>
  180. <xsl:variable name="v_refDataItem">
  181. <xsl:call-template name="getItemNameFromLevelReference">
  182. <xsl:with-param name="p_queryName" select="$v_refQuery"/>
  183. <xsl:with-param name="p_levelRef" select="$v_refLevel"/>
  184. </xsl:call-template>
  185. </xsl:variable>
  186. <xsl:choose>
  187. <xsl:when test="$v_refDataItem='ERROR: Cannot find item or dataItem for the level referenced.'">
  188. <xsl:comment>
  189. <xsl:call-template name="logError2">
  190. <xsl:with-param name="p_msgId" select="'RSU_SPC_LEVEL_KEYITEM_MISSING'"/>
  191. <xsl:with-param name="p_param1" select="'listColumnRowSpan'"/>
  192. <xsl:with-param name="p_param2" select="$v_refLevel"/>
  193. </xsl:call-template>
  194. </xsl:comment>
  195. </xsl:when>
  196. <xsl:otherwise>
  197. <listColumnRowSpan>
  198. <xsl:attribute name="refDataItem"><xsl:value-of select="$v_refDataItem"/></xsl:attribute>
  199. </listColumnRowSpan>
  200. </xsl:otherwise>
  201. </xsl:choose>
  202. </xsl:if>
  203. </listColumnBody>
  204. </xsl:template>
  205. <xsl:template match="/baltic:report/baltic:querySet/baltic:BIQuery" mode="list">
  206. <xsl:param name="p_list"/>
  207. <xsl:variable name="var_cube">
  208. <xsl:call-template name="getCubeOrCubeReference"/>
  209. </xsl:variable>
  210. <xsl:variable name="var_listGroups">
  211. <xsl:apply-templates select="$var_cube/baltic:cube/baltic:dimension/baltic:level" mode="list">
  212. <xsl:with-param name="p_list" select="$p_list"/>
  213. </xsl:apply-templates>
  214. </xsl:variable>
  215. <xsl:if test="count($var_cube/baltic:cube/baltic:dimension/baltic:level) &gt; 0">
  216. <listGroups>
  217. <xsl:copy-of select="$var_listGroups"/>
  218. </listGroups>
  219. </xsl:if>
  220. <xsl:element name="propertyList"/>
  221. <!-- Generate the sortList from the baltic:cube/baltic:factList/baltic:item sort attributes. -->
  222. <sortList>
  223. <xsl:apply-templates select="$var_cube/baltic:cube/baltic:factList/baltic:item" mode="generate_sortItems"/>
  224. </sortList>
  225. </xsl:template>
  226. <xsl:template match="baltic:cube/baltic:dimension/baltic:level" mode="list">
  227. <xsl:param name="p_list"/>
  228. <xsl:variable name="var_refLevel" select="@name"/>
  229. <xsl:variable name="v_refDataItem">
  230. <xsl:call-template name="getKeyItemNameForLevel"/>
  231. </xsl:variable>
  232. <xsl:choose>
  233. <xsl:when test="$v_refDataItem='ERROR: Cannot find item or dataItem for the level referenced.'">
  234. <xsl:comment>
  235. <xsl:call-template name="logError2">
  236. <xsl:with-param name="p_msgId" select="'RSU_SPC_LEVEL_KEYITEM_MISSING'"/>
  237. <xsl:with-param name="p_param1" select="'listGroup'"/>
  238. <xsl:with-param name="p_param2" select="$var_refLevel"/>
  239. </xsl:call-template>
  240. </xsl:comment>
  241. </xsl:when>
  242. <xsl:otherwise>
  243. <listGroup refDataItem="{$v_refDataItem}">
  244. <!-- Generate listHeader and listFooter from baltic:groupHeader and baltic:groupFooter with matching refLevel attribute. -->
  245. <xsl:apply-templates select="$p_list/baltic:groupHeader[@refLevel=$var_refLevel]"/>
  246. <xsl:apply-templates select="$p_list/baltic:groupFooter[@refLevel=$var_refLevel]"/>
  247. <xsl:element name="propertyList"/>
  248. <!-- Generate sortList from the baltic:item sort attributes up to this level in the current dimension. -->
  249. <sortList>
  250. <xsl:apply-templates select="baltic:item" mode="generate_sortItems"/>
  251. </sortList>
  252. </listGroup>
  253. </xsl:otherwise>
  254. </xsl:choose>
  255. </xsl:template>
  256. <xsl:template name="baltic:listOverallGroupTemplate">
  257. <xsl:if test="count(baltic:overallHeader) &gt; 0 or count(baltic:overallFooter) &gt; 0">
  258. <listOverallGroup>
  259. <xsl:apply-templates select="baltic:overallHeader"/>
  260. <xsl:apply-templates select="baltic:overallFooter"/>
  261. <xsl:variable name="var_cube">
  262. <xsl:call-template name="getCube">
  263. <xsl:with-param name="p_queryName" select="@refQuery"/>
  264. </xsl:call-template>
  265. </xsl:variable>
  266. </listOverallGroup>
  267. </xsl:if>
  268. </xsl:template>
  269. <xsl:template name="rowCellsStyleTemplate">
  270. <xsl:if test="count(baltic:style) &gt; 0 or count(baltic:XMLAttribute) &gt; 0 or
  271. count(baltic:conditionalStyle) &gt; 0">
  272. <rowCellsStyle>
  273. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  274. </rowCellsStyle>
  275. </xsl:if>
  276. </xsl:template>
  277. <xsl:template match="baltic:overallHeader">
  278. <listHeader>
  279. <xsl:if test="count(@repeatEveryPage) = 1">
  280. <xsl:attribute name="repeatEveryPage"><xsl:value-of select="@repeatEveryPage"/></xsl:attribute>
  281. </xsl:if>
  282. <!-- Output empty property list so location can be found when parsing expressions.
  283. * It will be removed during Bering post processing phase of upgrade, if it is still empty.
  284. -->
  285. <propertyList/>
  286. <listRows>
  287. <xsl:apply-templates select="baltic:rowCells"/>
  288. </listRows>
  289. </listHeader>
  290. </xsl:template>
  291. <xsl:template match="baltic:overallFooter">
  292. <listFooter>
  293. <xsl:if test="count(@pushToBottom) = 1">
  294. <xsl:attribute name="pushToBottom"><xsl:value-of select="@pushToBottom"/></xsl:attribute>
  295. </xsl:if>
  296. <!-- Output empty property list so location can be found when parsing expressions.
  297. * It will be removed during Bering post processing phase of upgrade, if it is still empty.
  298. -->
  299. <propertyList/>
  300. <listRows>
  301. <xsl:apply-templates select="baltic:rowCells"/>
  302. </listRows>
  303. </listFooter>
  304. </xsl:template>
  305. <xsl:template match="baltic:listHeader">
  306. <listPageHeader>
  307. <xsl:if test="count(@afterOverallHeader) = 1">
  308. <xsl:attribute name="afterOverallHeader"><xsl:value-of select="@afterOverallHeader"/></xsl:attribute>
  309. </xsl:if>
  310. <listRows>
  311. <xsl:apply-templates select="baltic:rowCells"/>
  312. </listRows>
  313. </listPageHeader>
  314. </xsl:template>
  315. <xsl:template match="baltic:listFooter">
  316. <listPageFooter>
  317. <xsl:if test="count(@pushToBottom) = 1">
  318. <xsl:attribute name="pushToBottom"><xsl:value-of select="@pushToBottom"/></xsl:attribute>
  319. </xsl:if>
  320. <listRows>
  321. <xsl:apply-templates select="baltic:rowCells"/>
  322. </listRows>
  323. </listPageFooter>
  324. </xsl:template>
  325. <xsl:template match="baltic:groupHeader">
  326. <xsl:if test="//baltic:rowCell">
  327. <listHeader>
  328. <xsl:if test="count(@repeatEveryPage) = 1">
  329. <xsl:attribute name="repeatEveryPage"><xsl:value-of select="@repeatEveryPage"/></xsl:attribute>
  330. </xsl:if>
  331. <!-- Output empty property list so location can be found when parsing expressions.
  332. * It will be removed during Bering post processing phase of upgrade, if it is still empty.
  333. -->
  334. <propertyList/>
  335. <listRows>
  336. <xsl:apply-templates select="baltic:rowCells"/>
  337. </listRows>
  338. <xsl:call-template name="rowCellsStyleTemplate"/>
  339. </listHeader>
  340. </xsl:if>
  341. </xsl:template>
  342. <xsl:template match="baltic:groupFooter">
  343. <xsl:if test="//baltic:rowCell">
  344. <listFooter>
  345. <xsl:if test="count(@pushToBottom) = 1">
  346. <xsl:attribute name="pushToBottom"><xsl:value-of select="@pushToBottom"/></xsl:attribute>
  347. </xsl:if>
  348. <!-- Output empty property list so location can be found when parsing expressions.
  349. * It will be removed during Bering post processing phase of upgrade, if it is still empty.
  350. -->
  351. <propertyList/>
  352. <listRows>
  353. <xsl:apply-templates select="baltic:rowCells"/>
  354. </listRows>
  355. <xsl:call-template name="rowCellsStyleTemplate"/>
  356. </listFooter>
  357. </xsl:if>
  358. </xsl:template>
  359. <xsl:template match="baltic:rowCells">
  360. <!-- NOTE: the baltic:rowCells becomes bering:listRow. The bering:rowCells is just a simple container for rowCell elements. -->
  361. <listRow>
  362. <rowCells>
  363. <xsl:apply-templates select="baltic:rowCell"/>
  364. </rowCells>
  365. <xsl:call-template name="rowCellsStyleTemplate"/>
  366. </listRow>
  367. </xsl:template>
  368. <xsl:template match="baltic:rowCell">
  369. <rowCell>
  370. <xsl:call-template name="addStyle"/>
  371. <xsl:if test="count(@colSpan) = 1">
  372. <xsl:attribute name="colSpan"><xsl:value-of select="@colSpan"/></xsl:attribute>
  373. </xsl:if>
  374. <xsl:call-template name="layoutContainerGroupTemplate"/>
  375. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  376. </rowCell>
  377. </xsl:template>
  378. <xsl:template match="baltic:table">
  379. <xsl:variable name="var_tableRows">
  380. <xsl:apply-templates select="baltic:tableRow"/>
  381. </xsl:variable>
  382. <table>
  383. <xsl:if test="count(@id) = 1">
  384. <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
  385. </xsl:if>
  386. <xsl:call-template name="addStyle"/>
  387. <tableRows>
  388. <xsl:copy-of select="$var_tableRows"/>
  389. </tableRows>
  390. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  391. </table>
  392. </xsl:template>
  393. <xsl:template match="baltic:tableRow">
  394. <xsl:variable name="var_tableCells">
  395. <xsl:apply-templates select="baltic:tableCell"/>
  396. </xsl:variable>
  397. <tableRow>
  398. <tableCells>
  399. <xsl:copy-of select="$var_tableCells"/>
  400. </tableCells>
  401. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  402. </tableRow>
  403. </xsl:template>
  404. <xsl:template match="baltic:tableCell">
  405. <tableCell>
  406. <xsl:call-template name="addStyle"/>
  407. <xsl:if test="count(@colSpan) = 1">
  408. <xsl:attribute name="colSpan"><xsl:value-of select="@colSpan"/></xsl:attribute>
  409. </xsl:if>
  410. <xsl:call-template name="layoutContainerGroupTemplate"/>
  411. <xsl:call-template name="simpleLayoutGroupTemplate"/>
  412. </tableCell>
  413. </xsl:template>
  414. <xsl:template match="baltic:block">
  415. <block>
  416. <xsl:if test="count(@id) = 1">
  417. <xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute>
  418. </xsl:if>
  419. <xsl:call-template name="addStyle"/>
  420. <xsl:call-template name="layoutContainerTemplate"/>
  421. </block>
  422. </xsl:template>
  423. <xsl:template match="baltic:conditionalBlockList">
  424. <xsl:variable name="v_refVariableExists">
  425. <xsl:call-template name="checkRefVariableTemplate"/>
  426. </xsl:variable>
  427. <xsl:if test="$v_refVariableExists = 'true'">
  428. <conditionalBlocks>
  429. <xsl:if test="baltic:conditionalBlock[@refVariableValue]">
  430. <conditionalBlockCases>
  431. <xsl:attribute name="refVariable"><xsl:value-of select="@refVariable"/></xsl:attribute>
  432. <xsl:apply-templates select="baltic:conditionalBlock[@refVariableValue]"/>
  433. </conditionalBlockCases>
  434. </xsl:if>
  435. <conditionalBlockDefault>
  436. <xsl:apply-templates select="baltic:conditionalBlock[not(@refVariableValue)]"/>
  437. </conditionalBlockDefault>
  438. </conditionalBlocks>
  439. </xsl:if>
  440. </xsl:template>
  441. <xsl:template match="baltic:conditionalBlock[@refVariableValue]">
  442. <conditionalBlock>
  443. <xsl:call-template name="addStyle"/>
  444. <xsl:attribute name="refVariableValue"><xsl:value-of select="@refVariableValue"/></xsl:attribute>
  445. <xsl:call-template name="layoutContainerTemplate"/>
  446. </conditionalBlock>
  447. </xsl:template>
  448. <xsl:template match="baltic:conditionalBlock[not(@refVariableValue)]">
  449. <xsl:call-template name="layoutContainerTemplate"/>
  450. </xsl:template>
  451. </xsl:stylesheet>