meta.xsl 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: CCS
  5. (c) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns="http://developer.cognos.com/schemas/rds/types/1" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdsCM="http://developer.cognos.com/schemas/rds/contentmodel/1">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:template match="/">
  11. <document>
  12. <xsl:apply-templates select="/report/layouts/layout/reportPages/*">
  13. <xsl:with-param name="posId">./layouts/layout/reportPages</xsl:with-param>
  14. </xsl:apply-templates>
  15. </document>
  16. </xsl:template>
  17. <xsl:template priority="2" match="*[contains(style/CSS/@value, 'visibility:hidden') ]"/>
  18. <xsl:template name="page">
  19. <xsl:param name="posId"/>
  20. <xsl:variable name="countType">
  21. <xsl:value-of select="count(../page)"/>
  22. </xsl:variable>
  23. <xsl:variable name="index">
  24. <xsl:value-of select="1 + count(preceding-sibling::page)"/>
  25. </xsl:variable>
  26. <page>
  27. <xsl:if test="@name">
  28. <rdsCM:id>
  29. <xsl:value-of select="@name"/>
  30. </rdsCM:id>
  31. </xsl:if>
  32. <posId>
  33. <xsl:choose>
  34. <xsl:when test="$countType &gt; 1">
  35. <xsl:value-of select="concat('./layouts/layout/reportPages/page[',$index,']')"/>
  36. </xsl:when>
  37. <xsl:otherwise>./layouts/layout/reportPages/page</xsl:otherwise>
  38. </xsl:choose>
  39. </posId>
  40. <xsl:if test="pageHeader/contents/*">
  41. <header>
  42. <xsl:apply-templates select="pageHeader/contents/*">
  43. <xsl:with-param name="posId">
  44. <xsl:choose>
  45. <xsl:when test="$countType &gt; 1">
  46. <xsl:value-of select="concat($posId, '/page[',$index,']/pageHeader/contents')"/>
  47. </xsl:when>
  48. <xsl:otherwise>
  49. <xsl:value-of select="concat($posId,'/page/pageHeader/contents')"/>
  50. </xsl:otherwise>
  51. </xsl:choose>
  52. </xsl:with-param>
  53. <xsl:with-param name="conditional">false</xsl:with-param>
  54. </xsl:apply-templates>
  55. </header>
  56. </xsl:if>
  57. <xsl:if test="pageBody/contents/*">
  58. <body>
  59. <xsl:apply-templates select="pageBody/contents/*">
  60. <xsl:with-param name="posId">
  61. <xsl:choose>
  62. <xsl:when test="$countType &gt; 1">
  63. <xsl:value-of select="concat($posId, '/page[',$index,']/pageBody/contents')"/>
  64. </xsl:when>
  65. <xsl:otherwise>
  66. <xsl:value-of select="concat($posId,'/page/pageBody/contents')"/>
  67. </xsl:otherwise>
  68. </xsl:choose>
  69. </xsl:with-param>
  70. <xsl:with-param name="conditional">false</xsl:with-param>
  71. </xsl:apply-templates>
  72. </body>
  73. </xsl:if>
  74. <xsl:if test="pageFooter/contents/*">
  75. <footer>
  76. <xsl:apply-templates select="pageFooter/contents/*">
  77. <xsl:with-param name="posId">
  78. <xsl:choose>
  79. <xsl:when test="$countType &gt; 1">
  80. <xsl:value-of select="concat($posId, '/page[',$index,']/pageFooter/contents')"/>
  81. </xsl:when>
  82. <xsl:otherwise>
  83. <xsl:value-of select="concat($posId,'/page/pageFooter/contents')"/>
  84. </xsl:otherwise>
  85. </xsl:choose>
  86. </xsl:with-param>
  87. <xsl:with-param name="conditional">false</xsl:with-param>
  88. </xsl:apply-templates>
  89. </footer>
  90. </xsl:if>
  91. </page>
  92. </xsl:template>
  93. <xsl:template match="page">
  94. <xsl:param name="posId"/>
  95. <xsl:call-template name="page">
  96. <xsl:with-param name="posId" select="$posId"/>
  97. </xsl:call-template>
  98. </xsl:template>
  99. <xsl:template match="page[pageSections]">
  100. <xsl:param name="posId"/>
  101. <xsl:variable name="countMembers" select="count(pageSections/pageSection/pageSectionDefinition/dmMembers/dmMember)"/>
  102. <pageGroup>
  103. <xsl:choose>
  104. <xsl:when test="$countMembers = 1">
  105. <rdsCM:id>
  106. <xsl:value-of select="concat('children(', pageSections/pageSection/pageSectionDefinition/dmMembers/dmMember/itemCaption, ')')"/>
  107. </rdsCM:id>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <rdsCM:id>
  111. <xsl:value-of select="concat(pageSections/pageSection/dmHierarchy/itemCaption, ' (list)')"/>
  112. </rdsCM:id>
  113. </xsl:otherwise>
  114. </xsl:choose>
  115. <xsl:call-template name="page">
  116. <xsl:with-param name="posId" select="$posId"/>
  117. </xsl:call-template>
  118. </pageGroup>
  119. </xsl:template>
  120. <xsl:template match="pageSet">
  121. <xsl:variable name="countType">
  122. <xsl:value-of select="count(../pageSet)"/>
  123. </xsl:variable>
  124. <xsl:variable name="index">
  125. <xsl:value-of select="1 + count(preceding-sibling::pageSet)"/>
  126. </xsl:variable>
  127. <xsl:apply-templates select="pageOverallGroup/headerPages/*">
  128. <xsl:with-param name="posId">
  129. <xsl:choose>
  130. <xsl:when test="$countType &gt; 1">
  131. <xsl:value-of select="concat('./layouts/layout/reportPages/pageSet[',$index,']/pageOverallGroup/headerPages')"/>
  132. </xsl:when>
  133. <xsl:otherwise>./layouts/layout/reportPages/pageSet/pageOverallGroup/headerPages</xsl:otherwise>
  134. </xsl:choose>
  135. </xsl:with-param>
  136. <xsl:with-param name="conditional">false</xsl:with-param>
  137. </xsl:apply-templates>
  138. <xsl:if test="count(pageGroups) = 0">
  139. <xsl:apply-templates select="detailPages/*">
  140. <xsl:with-param name="posId">
  141. <xsl:choose>
  142. <xsl:when test="$countType &gt; 1">
  143. <xsl:value-of select="concat('./layouts/layout/reportPages/pageSet[',$index,']/detailPages')"/>
  144. </xsl:when>
  145. <xsl:otherwise>./layouts/layout/reportPages/pageSet/detailPages</xsl:otherwise>
  146. </xsl:choose>
  147. </xsl:with-param>
  148. </xsl:apply-templates>
  149. </xsl:if>
  150. <xsl:apply-templates select="pageGroups/*">
  151. <xsl:with-param name="posId">
  152. <xsl:choose>
  153. <xsl:when test="$countType &gt; 1">
  154. <xsl:value-of select="concat('./layouts/layout/reportPages/pageSet[',$index,']/pageGroups')"/>
  155. </xsl:when>
  156. <xsl:otherwise>./layouts/layout/reportPages/pageSet/pageGroups</xsl:otherwise>
  157. </xsl:choose>
  158. </xsl:with-param>
  159. <xsl:with-param name="conditional">false</xsl:with-param>
  160. <xsl:with-param name="detailPages" select="detailPages/*"/>
  161. </xsl:apply-templates>
  162. <xsl:apply-templates select="pageOverallGroup/footerPages/*">
  163. <xsl:with-param name="posId">
  164. <xsl:choose>
  165. <xsl:when test="$countType &gt; 1">
  166. <xsl:value-of select="concat('./layouts/layout/reportPages/pageSet[',$index,']/pageOverallGroup/footerPages')"/>
  167. </xsl:when>
  168. <xsl:otherwise>./layouts/layout/reportPages/pageSet/pageOverallGroup/footerPages</xsl:otherwise>
  169. </xsl:choose>
  170. </xsl:with-param>
  171. <xsl:with-param name="conditional">false</xsl:with-param>
  172. </xsl:apply-templates>
  173. </xsl:template>
  174. <xsl:template match="pageGroup">
  175. <xsl:param name="posId"/>
  176. <xsl:param name="conditional"/>
  177. <xsl:param name="detailPages"/>
  178. <xsl:variable name="countType">
  179. <xsl:value-of select="count(../table)"/>
  180. </xsl:variable>
  181. <xsl:variable name="index">
  182. <xsl:value-of select="1 + count(preceding-sibling::pageGroup)"/>
  183. </xsl:variable>
  184. <pageGroup>
  185. <xsl:if test="@refDataItem">
  186. <rdsCM:id>
  187. <xsl:value-of select="@refDataItem"/>
  188. </rdsCM:id>
  189. </xsl:if>
  190. <xsl:apply-templates select="headerPages/*">
  191. <xsl:with-param name="posId">
  192. <xsl:choose>
  193. <xsl:when test="$countType &gt; 1">
  194. <xsl:value-of select="concat($posId,'/headerPages[',$index,']')"/>
  195. </xsl:when>
  196. <xsl:otherwise>
  197. <xsl:value-of select="concat($posId,'/headerPages')"/>
  198. </xsl:otherwise>
  199. </xsl:choose>
  200. </xsl:with-param>
  201. <xsl:with-param name="conditional">
  202. <xsl:value-of select="$conditional"/>
  203. </xsl:with-param>
  204. </xsl:apply-templates>
  205. <xsl:apply-templates select="$detailPages">
  206. <xsl:with-param name="posId">
  207. <xsl:choose>
  208. <xsl:when test="$countType &gt; 1">
  209. <xsl:value-of select="concat($posId,'/headerPages[',$index,']')"/>
  210. </xsl:when>
  211. <xsl:otherwise>
  212. <xsl:value-of select="concat($posId,'/headerPages')"/>
  213. </xsl:otherwise>
  214. </xsl:choose>
  215. </xsl:with-param>
  216. <xsl:with-param name="conditional">
  217. <xsl:value-of select="$conditional"/>
  218. </xsl:with-param>
  219. </xsl:apply-templates>
  220. <xsl:apply-templates select="footerPages/*">
  221. <xsl:with-param name="posId">
  222. <xsl:choose>
  223. <xsl:when test="$countType &gt; 1">
  224. <xsl:value-of select="concat($posId,'/footerPages[',$index,']')"/>
  225. </xsl:when>
  226. <xsl:otherwise>
  227. <xsl:value-of select="concat($posId,'/footerPages')"/>
  228. </xsl:otherwise>
  229. </xsl:choose>
  230. </xsl:with-param>
  231. <xsl:with-param name="conditional">
  232. <xsl:value-of select="$conditional"/>
  233. </xsl:with-param>
  234. </xsl:apply-templates>
  235. </pageGroup>
  236. </xsl:template>
  237. <xsl:template match="table">
  238. <xsl:param name="posId"/>
  239. <xsl:param name="conditional"/>
  240. <xsl:variable name="countType">
  241. <xsl:value-of select="count(../table)"/>
  242. </xsl:variable>
  243. <xsl:variable name="index">
  244. <xsl:value-of select="1 + count(preceding-sibling::table)"/>
  245. </xsl:variable>
  246. <xsl:apply-templates select="tableRows/tableRow">
  247. <xsl:with-param name="posId">
  248. <xsl:choose>
  249. <xsl:when test="$countType &gt; 1">
  250. <xsl:value-of select="concat($posId,'/table[',$index,']')"/>
  251. </xsl:when>
  252. <xsl:otherwise>
  253. <xsl:value-of select="concat($posId,'/table')"/>
  254. </xsl:otherwise>
  255. </xsl:choose>
  256. </xsl:with-param>
  257. <xsl:with-param name="conditional">
  258. <xsl:value-of select="$conditional"/>
  259. </xsl:with-param>
  260. </xsl:apply-templates>
  261. </xsl:template>
  262. <xsl:template match="tableRow">
  263. <xsl:param name="posId"/>
  264. <xsl:param name="conditional"/>
  265. <xsl:variable name="countType">
  266. <xsl:value-of select="count(../tableRow)"/>
  267. </xsl:variable>
  268. <xsl:variable name="index">
  269. <xsl:value-of select="1 + count(preceding-sibling::tableRow)"/>
  270. </xsl:variable>
  271. <xsl:apply-templates select="tableCells/tableCell">
  272. <xsl:with-param name="posId">
  273. <xsl:choose>
  274. <xsl:when test="$countType &gt; 1">
  275. <xsl:value-of select="concat($posId,'/tableRows/tableRow[',$index,']')"/>
  276. </xsl:when>
  277. <xsl:otherwise>
  278. <xsl:value-of select="concat($posId,'/tableRows/tableRow')"/>
  279. </xsl:otherwise>
  280. </xsl:choose>
  281. </xsl:with-param>
  282. <xsl:with-param name="conditional">
  283. <xsl:value-of select="$conditional"/>
  284. </xsl:with-param>
  285. </xsl:apply-templates>
  286. </xsl:template>
  287. <xsl:template match="tableCell">
  288. <xsl:param name="posId"/>
  289. <xsl:param name="conditional"/>
  290. <xsl:variable name="countType">
  291. <xsl:value-of select="count(../tableCell)"/>
  292. </xsl:variable>
  293. <xsl:variable name="index">
  294. <xsl:value-of select="1 + count(preceding-sibling::tableCell)"/>
  295. </xsl:variable>
  296. <xsl:apply-templates select="contents/*">
  297. <xsl:with-param name="posId">
  298. <xsl:choose>
  299. <xsl:when test="$countType &gt; 1">
  300. <xsl:value-of select="concat($posId,'/tableCells/tableCell[',$index,']/contents')"/>
  301. </xsl:when>
  302. <xsl:otherwise>
  303. <xsl:value-of select="concat($posId,'/tableCells/tableCell/contents')"/>
  304. </xsl:otherwise>
  305. </xsl:choose>
  306. </xsl:with-param>
  307. <xsl:with-param name="conditional">
  308. <xsl:value-of select="$conditional"/>
  309. </xsl:with-param>
  310. </xsl:apply-templates>
  311. </xsl:template>
  312. <xsl:template match="block">
  313. <xsl:param name="posId"/>
  314. <xsl:param name="conditional"/>
  315. <xsl:variable name="countType">
  316. <xsl:value-of select="count(../block)"/>
  317. </xsl:variable>
  318. <xsl:variable name="index">
  319. <xsl:value-of select="1 + count(preceding-sibling::block)"/>
  320. </xsl:variable>
  321. <xsl:apply-templates select="contents/*">
  322. <xsl:with-param name="posId">
  323. <xsl:choose>
  324. <xsl:when test="$countType &gt; 1">
  325. <xsl:value-of select="concat($posId,'/block[',$index,']/contents')"/>
  326. </xsl:when>
  327. <xsl:otherwise>
  328. <xsl:value-of select="concat($posId,'/block/contents')"/>
  329. </xsl:otherwise>
  330. </xsl:choose>
  331. </xsl:with-param>
  332. <xsl:with-param name="conditional">
  333. <xsl:value-of select="$conditional"/>
  334. </xsl:with-param>
  335. </xsl:apply-templates>
  336. </xsl:template>
  337. <xsl:template match="list">
  338. <xsl:param name="posId"/>
  339. <xsl:param name="conditional"/>
  340. <xsl:variable name="countType">
  341. <xsl:value-of select="count(../list)"/>
  342. </xsl:variable>
  343. <xsl:variable name="refQuery">
  344. <xsl:value-of select="@refQuery"/>
  345. </xsl:variable>
  346. <xsl:variable name="index">
  347. <xsl:value-of select="1 + count(preceding-sibling::list)"/>
  348. </xsl:variable>
  349. <xsl:variable name="visibleColls">
  350. <xsl:value-of select="count(listColumns/listColumn/*[style/CSS[not(contains(@value,'display:none'))] or style[not(CSS)]])"/>
  351. </xsl:variable>
  352. <item>
  353. <posId>
  354. <xsl:choose>
  355. <xsl:when test="$countType &gt; 1">
  356. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  357. </xsl:when>
  358. <xsl:otherwise>
  359. <xsl:value-of select="concat($posId,'/list')"/>
  360. </xsl:otherwise>
  361. </xsl:choose>
  362. </posId>
  363. <conditional>
  364. <xsl:choose>
  365. <xsl:when test="./conditionalRender">true</xsl:when>
  366. <xsl:otherwise>
  367. <xsl:value-of select="$conditional"/>
  368. </xsl:otherwise>
  369. </xsl:choose>
  370. </conditional>
  371. <MListFrame>
  372. <xsl:variable name="listId">
  373. <xsl:choose>
  374. <xsl:when test="$countType &gt; 1">
  375. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  376. </xsl:when>
  377. <xsl:otherwise>
  378. <xsl:value-of select="concat($posId,'/list')"/>
  379. </xsl:otherwise>
  380. </xsl:choose>
  381. </xsl:variable>
  382. <xsl:if test="@name">
  383. <rdsCM:id>
  384. <xsl:value-of select="@name"/>
  385. </rdsCM:id>
  386. </xsl:if>
  387. <xsl:if test="$visibleColls &gt; 0">
  388. <columns>
  389. <xsl:choose>
  390. <xsl:when test="@showColumnTitles='hide'">
  391. <xsl:for-each select="listColumns/listColumn">
  392. <xsl:if test="*[not(contains(style/CSS/@value,'display:none'))]">
  393. <column>
  394. <title>
  395. <xsl:value-of select="concat('Column', position())"/>
  396. <!--<title>
  397. <xsl:variable name="refDataItem" select="listColumnTitle/contents/*/dataSource/dataItemLabel/@refDataItem"/>
  398. <xsl:variable name="label" select="/report/queries/query/selection/*[@name=$refDataItem and @label]/@label"/>
  399. <xsl:choose>
  400. <xsl:when test="$refDataItem">
  401. <xsl:choose>
  402. <xsl:when test="$label">
  403. <xsl:value-of select="$label"/>
  404. </xsl:when>
  405. <xsl:otherwise>
  406. <xsl:value-of select="$refDataItem"/>
  407. </xsl:otherwise>
  408. </xsl:choose>
  409. </xsl:when>
  410. <xsl:otherwise>
  411. <xsl:value-of select="listColumnTitle/contents/textItem/dataSource/staticValue"/>
  412. </xsl:otherwise>
  413. </xsl:choose>-->
  414. </title>
  415. <contents>
  416. <xsl:apply-templates select="listColumnBody/contents/*">
  417. <xsl:with-param name="posId">
  418. <xsl:value-of select="concat($listId, '/listColumnBody/contents')"/>
  419. </xsl:with-param>
  420. <xsl:with-param name="conditional">
  421. <xsl:value-of select="$conditional"/>
  422. </xsl:with-param>
  423. </xsl:apply-templates>
  424. </contents>
  425. </column>
  426. </xsl:if>
  427. </xsl:for-each>
  428. </xsl:when>
  429. <xsl:otherwise>
  430. <xsl:for-each select="listColumns/listColumn">
  431. <xsl:if test="*[not(contains(style/CSS/@value,'display:none'))]">
  432. <column>
  433. <title>
  434. <xsl:variable name="refDataItem" select="listColumnTitle/contents/*/dataSource/dataItemLabel/@refDataItem"/>
  435. <xsl:variable name="label" select="/report/queries/query[@name=$refQuery]/selection/*[@name=$refDataItem and @label]/@label"/>
  436. <xsl:choose>
  437. <xsl:when test="$refDataItem">
  438. <xsl:choose>
  439. <xsl:when test="$label">
  440. <xsl:value-of select="$label"/>
  441. </xsl:when>
  442. <xsl:otherwise>
  443. <xsl:value-of select="$refDataItem"/>
  444. </xsl:otherwise>
  445. </xsl:choose>
  446. </xsl:when>
  447. <xsl:otherwise>
  448. <xsl:value-of select="listColumnTitle/contents/textItem/dataSource/staticValue"/>
  449. </xsl:otherwise>
  450. </xsl:choose>
  451. </title>
  452. <contents>
  453. <xsl:apply-templates select="listColumnBody/contents/*">
  454. <xsl:with-param name="posId">
  455. <xsl:value-of select="concat($listId, '/listColumnBody/contents')"/>
  456. </xsl:with-param>
  457. <xsl:with-param name="conditional">
  458. <xsl:value-of select="$conditional"/>
  459. </xsl:with-param>
  460. <xsl:with-param name="refQuery">
  461. <xsl:value-of select="$refQuery"/>
  462. </xsl:with-param>
  463. </xsl:apply-templates>
  464. </contents>
  465. </column>
  466. </xsl:if>
  467. </xsl:for-each>
  468. </xsl:otherwise>
  469. </xsl:choose>
  470. </columns>
  471. </xsl:if>
  472. <xsl:apply-templates select="listGroups/*">
  473. <xsl:with-param name="posId">
  474. <xsl:value-of select="concat($listId, '/listGroups')"/>
  475. </xsl:with-param>
  476. <xsl:with-param name="conditional">
  477. <xsl:value-of select="$conditional"/>
  478. </xsl:with-param>
  479. </xsl:apply-templates>
  480. <xsl:apply-templates select="listOverallGroup/*">
  481. <xsl:with-param name="posId">
  482. <xsl:value-of select="$listId"/>
  483. </xsl:with-param>
  484. <xsl:with-param name="conditional">
  485. <xsl:value-of select="$conditional"/>
  486. </xsl:with-param>
  487. </xsl:apply-templates>
  488. </MListFrame>
  489. </item>
  490. </xsl:template>
  491. <xsl:template match="listGroup">
  492. <xsl:param name="posId"/>
  493. <xsl:param name="conditional"/>
  494. <xsl:param name="refQuery"/>
  495. <xsl:variable name="countType">
  496. <xsl:value-of select="count(../list)"/>
  497. </xsl:variable>
  498. <xsl:variable name="index">
  499. <xsl:value-of select="1 + count(preceding-sibling::list)"/>
  500. </xsl:variable>
  501. <xsl:variable name="listGroupId">
  502. <xsl:choose>
  503. <xsl:when test="$countType &gt; 1">
  504. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  505. </xsl:when>
  506. <xsl:otherwise>
  507. <xsl:value-of select="concat($posId,'/list')"/>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </xsl:variable>
  511. <listGroup>
  512. <key>
  513. <xsl:variable name="refDataItem" select="@refDataItem"/>
  514. <xsl:variable name="label" select="/report/queries/query[@name=$refQuery]/selection/*[@name=$refDataItem and @label]/@label"/>
  515. <xsl:choose>
  516. <xsl:when test="$label">
  517. <xsl:value-of select="$label"/>
  518. </xsl:when>
  519. <xsl:otherwise>
  520. <xsl:value-of select="$refDataItem"/>
  521. </xsl:otherwise>
  522. </xsl:choose>
  523. </key>
  524. <xsl:apply-templates select="*">
  525. <xsl:with-param name="posId">
  526. <xsl:value-of select="$listGroupId"/>
  527. </xsl:with-param>
  528. <xsl:with-param name="conditional">
  529. <xsl:value-of select="$conditional"/>
  530. </xsl:with-param>
  531. </xsl:apply-templates>
  532. </listGroup>
  533. </xsl:template>
  534. <xsl:template match="listHeader | listFooter">
  535. <xsl:param name="posId"/>
  536. <xsl:param name="conditional"/>
  537. <xsl:variable name="listSectionId">
  538. <xsl:value-of select="concat($posId,'/',name())"/>
  539. </xsl:variable>
  540. <xsl:element name="{name()}">
  541. <xsl:apply-templates select="listRows/listRow">
  542. <xsl:with-param name="posId">
  543. <xsl:value-of select="$listSectionId"/>
  544. </xsl:with-param>
  545. <xsl:with-param name="conditional">
  546. <xsl:value-of select="$conditional"/>
  547. </xsl:with-param>
  548. </xsl:apply-templates>
  549. </xsl:element>
  550. </xsl:template>
  551. <xsl:template match="listRow">
  552. <xsl:param name="posId"/>
  553. <xsl:param name="conditional"/>
  554. <xsl:variable name="listRowId">
  555. <xsl:value-of select="concat($posId,'/listRow')"/>
  556. </xsl:variable>
  557. <xsl:variable name="visibleCells">
  558. <xsl:value-of select="count(rowCells/rowCell[style/CSS[not(contains(@value,'display:none'))] or style[not(CSS)] ])"/>
  559. </xsl:variable>
  560. <xsl:if test="$visibleCells &gt; 0">
  561. <listRow>
  562. <xsl:apply-templates select="rowCells/rowCell">
  563. <xsl:with-param name="posId">
  564. <xsl:value-of select="$listRowId"/>
  565. </xsl:with-param>
  566. <xsl:with-param name="conditional">
  567. <xsl:value-of select="$conditional"/>
  568. </xsl:with-param>
  569. </xsl:apply-templates>
  570. </listRow>
  571. </xsl:if>
  572. </xsl:template>
  573. <xsl:template match="rowCell">
  574. <xsl:param name="posId"/>
  575. <xsl:param name="conditional"/>
  576. <xsl:variable name="rowCellId">ll
  577. <xsl:value-of select="concat($posId,'/rowCell')"/>
  578. </xsl:variable>
  579. <xsl:if test="not(contains(style/CSS/@value,'display:none'))">
  580. <rowCell>
  581. <xsl:choose>
  582. <xsl:when test="@colSpan">
  583. <xsl:attribute name="colSpan"><xsl:value-of select="@colSpan"/></xsl:attribute>
  584. </xsl:when>
  585. <xsl:otherwise>
  586. <xsl:attribute name="colSpan">1</xsl:attribute>
  587. </xsl:otherwise>
  588. </xsl:choose>
  589. <xsl:apply-templates select="contents/*">
  590. <xsl:with-param name="posId">
  591. <xsl:value-of select="$rowCellId"/>
  592. </xsl:with-param>
  593. <xsl:with-param name="conditional">
  594. <xsl:value-of select="$conditional"/>
  595. </xsl:with-param>
  596. </xsl:apply-templates>
  597. </rowCell>
  598. </xsl:if>
  599. </xsl:template>
  600. <xsl:template match="TOC">
  601. <xsl:param name="posId"/>
  602. <xsl:param name="conditional"/>
  603. <xsl:variable name="countType">
  604. <xsl:value-of select="count(../TOC)"/>
  605. </xsl:variable>
  606. <xsl:variable name="index">
  607. <xsl:value-of select="1 + count(preceding-sibling::TOC)"/>
  608. </xsl:variable>
  609. <item>
  610. <posId>
  611. <xsl:choose>
  612. <xsl:when test="$countType &gt; 1">
  613. <xsl:value-of select="concat($posId,'/TOC[',$index,']')"/>
  614. </xsl:when>
  615. <xsl:otherwise>
  616. <xsl:value-of select="concat($posId,'/TOC')"/>
  617. </xsl:otherwise>
  618. </xsl:choose>
  619. </posId>
  620. <conditional>
  621. <xsl:choose>
  622. <xsl:when test="./conditionalRender">true</xsl:when>
  623. <xsl:otherwise>
  624. <xsl:value-of select="$conditional"/>
  625. </xsl:otherwise>
  626. </xsl:choose>
  627. </conditional>
  628. <MTableOfContents>
  629. <xsl:if test="@tocName">
  630. <rdsCM:id>
  631. <xsl:value-of select="@tocName"/>
  632. </rdsCM:id>
  633. </xsl:if>
  634. </MTableOfContents>
  635. </item>
  636. </xsl:template>
  637. <xsl:template match="textItem">
  638. <xsl:param name="conditional"/>
  639. <xsl:param name="posId"/>
  640. <xsl:variable name="countType">
  641. <xsl:value-of select="count(../textItem)"/>
  642. </xsl:variable>
  643. <xsl:variable name="index">
  644. <xsl:value-of select="1 + count(preceding-sibling::textItem)"/>
  645. </xsl:variable>
  646. <item>
  647. <posId>
  648. <xsl:choose>
  649. <xsl:when test="$countType &gt; 1">
  650. <xsl:value-of select="concat($posId,'/textItem[',$index,']')"/>
  651. </xsl:when>
  652. <xsl:otherwise>
  653. <xsl:value-of select="concat($posId,'/textItem')"/>
  654. </xsl:otherwise>
  655. </xsl:choose>
  656. </posId>
  657. <conditional>
  658. <xsl:choose>
  659. <xsl:when test="./conditionalRender">true</xsl:when>
  660. <xsl:otherwise>
  661. <xsl:value-of select="$conditional"/>
  662. </xsl:otherwise>
  663. </xsl:choose>
  664. </conditional>
  665. <MTextFrame>
  666. <xsl:if test="@name">
  667. <rdsCM:id>
  668. <xsl:value-of select="@name"/>
  669. </rdsCM:id>
  670. </xsl:if>
  671. </MTextFrame>
  672. </item>
  673. </xsl:template>
  674. <xsl:template match="image">
  675. <xsl:param name="posId"/>
  676. <xsl:param name="conditional"/>
  677. <xsl:variable name="countType">
  678. <xsl:value-of select="count(../image)"/>
  679. </xsl:variable>
  680. <xsl:variable name="index">
  681. <xsl:value-of select="1 + count(preceding-sibling::image)"/>
  682. </xsl:variable>
  683. <item>
  684. <posId>
  685. <xsl:choose>
  686. <xsl:when test="$countType &gt; 1">
  687. <xsl:value-of select="concat($posId,'/image[',$index,']')"/>
  688. </xsl:when>
  689. <xsl:otherwise>
  690. <xsl:value-of select="concat($posId,'/image')"/>
  691. </xsl:otherwise>
  692. </xsl:choose>
  693. </posId>
  694. <conditional>
  695. <xsl:choose>
  696. <xsl:when test="./conditionalRender">true</xsl:when>
  697. <xsl:otherwise>
  698. <xsl:value-of select="$conditional"/>
  699. </xsl:otherwise>
  700. </xsl:choose>
  701. </conditional>
  702. <MImage>
  703. <xsl:if test="@name">
  704. <rdsCM:id>
  705. <xsl:value-of select="@name"/>
  706. </rdsCM:id>
  707. </xsl:if>
  708. </MImage>
  709. </item>
  710. </xsl:template>
  711. <xsl:template match="crosstab">
  712. <xsl:param name="posId"/>
  713. <xsl:param name="conditional"/>
  714. <xsl:variable name="countType">
  715. <xsl:value-of select="count(../crosstab)"/>
  716. </xsl:variable>
  717. <xsl:variable name="index">
  718. <xsl:value-of select="1 + count(preceding-sibling::crosstab)"/>
  719. </xsl:variable>
  720. <item>
  721. <xsl:variable name="xtabId">
  722. <xsl:choose>
  723. <xsl:when test="$countType &gt; 1">
  724. <xsl:value-of select="concat($posId,'/crosstab[',$index,']')"/>
  725. </xsl:when>
  726. <xsl:otherwise>
  727. <xsl:value-of select="concat($posId,'/crosstab')"/>
  728. </xsl:otherwise>
  729. </xsl:choose>
  730. </xsl:variable>
  731. <posId>
  732. <xsl:value-of select="$xtabId"/>
  733. </posId>
  734. <conditional>
  735. <xsl:choose>
  736. <xsl:when test="./conditionalRender">true</xsl:when>
  737. <xsl:otherwise>
  738. <xsl:value-of select="$conditional"/>
  739. </xsl:otherwise>
  740. </xsl:choose>
  741. </conditional>
  742. <MCrossTab>
  743. <xsl:if test="@name">
  744. <rdsCM:id>
  745. <xsl:value-of select="@name"/>
  746. </rdsCM:id>
  747. <corner>
  748. <xsl:apply-templates select="crosstabCorner/contents/*">
  749. <xsl:with-param name="posId">
  750. <xsl:value-of select="concat($xtabId, '/crosstabCorner/contents')"/>
  751. </xsl:with-param>
  752. <xsl:with-param name="conditional">
  753. <xsl:value-of select="$conditional"/>
  754. </xsl:with-param>
  755. </xsl:apply-templates>
  756. </corner>
  757. <columns>
  758. <xsl:apply-templates select="crosstabColumns/crosstabNode">
  759. <xsl:with-param name="posId">
  760. <xsl:value-of select="concat($xtabId, 'crosstabColumns/crosstabNode')"/>
  761. </xsl:with-param>
  762. <xsl:with-param name="conditional">
  763. <xsl:value-of select="$conditional"/>
  764. </xsl:with-param>
  765. </xsl:apply-templates>
  766. </columns>
  767. <rows>
  768. <xsl:apply-templates select="crosstabRows/crosstabNode">
  769. <xsl:with-param name="posId">
  770. <xsl:value-of select="concat($xtabId, 'crosstabRows/crosstabNode')"/>
  771. </xsl:with-param>
  772. <xsl:with-param name="conditional">
  773. <xsl:value-of select="$conditional"/>
  774. </xsl:with-param>
  775. </xsl:apply-templates>
  776. </rows>
  777. </xsl:if>
  778. </MCrossTab>
  779. </item>
  780. </xsl:template>
  781. <xsl:template match="crosstabNode">
  782. <xsl:param name="posId"/>
  783. <xsl:param name="conditional"/>
  784. <xsl:variable name="crosstabNodeId">
  785. <xsl:value-of select="concat($posId,'/crosstabNestedNodes')"/>
  786. </xsl:variable>
  787. <crosstabNode>
  788. <xsl:apply-templates select="*">
  789. <xsl:with-param name="posId">
  790. <xsl:value-of select="$crosstabNodeId"/>
  791. </xsl:with-param>
  792. <xsl:with-param name="conditional">
  793. <xsl:value-of select="$conditional"/>
  794. </xsl:with-param>
  795. </xsl:apply-templates>
  796. </crosstabNode>
  797. </xsl:template>
  798. <xsl:template match="crosstabNestedNodes">
  799. <xsl:param name="posId"/>
  800. <xsl:param name="conditional"/>
  801. <xsl:variable name="crosstabNestedNodesId">
  802. <xsl:value-of select="concat($posId,'/crosstabNestedNodes')"/>
  803. </xsl:variable>
  804. <nestedNodes>
  805. <xsl:apply-templates select="*">
  806. <xsl:with-param name="posId">
  807. <xsl:value-of select="$crosstabNestedNodesId"/>
  808. </xsl:with-param>
  809. <xsl:with-param name="conditional">
  810. <xsl:value-of select="$conditional"/>
  811. </xsl:with-param>
  812. </xsl:apply-templates>
  813. </nestedNodes>
  814. </xsl:template>
  815. <xsl:template match="crosstabNodeMembers">
  816. <xsl:param name="posId"/>
  817. <xsl:param name="conditional"/>
  818. <xsl:variable name="crosstabNodeMembersId">
  819. <xsl:value-of select="concat($posId,'/crosstabNodeMembers')"/>
  820. </xsl:variable>
  821. <members>
  822. <xsl:apply-templates select="*">
  823. <xsl:with-param name="posId">
  824. <xsl:value-of select="$crosstabNodeMembersId"/>
  825. </xsl:with-param>
  826. <xsl:with-param name="conditional">
  827. <xsl:value-of select="$conditional"/>
  828. </xsl:with-param>
  829. </xsl:apply-templates>
  830. </members>
  831. </xsl:template>
  832. <xsl:template match="crosstabNodeMember">
  833. <xsl:param name="posId"/>
  834. <xsl:param name="conditional"/>
  835. <xsl:variable name="crosstabNodeMemberId">
  836. <xsl:value-of select="concat($posId,'/crosstabNodeMember')"/>
  837. </xsl:variable>
  838. <member>
  839. <title>
  840. <xsl:variable name="staticValue" select="contents/textItem/dataSource/staticValue"/>
  841. <xsl:choose>
  842. <xsl:when test="$staticValue">
  843. <xsl:value-of select="$staticValue"/>
  844. </xsl:when>
  845. <xsl:otherwise>
  846. <xsl:value-of select="@refDataItem"/>
  847. </xsl:otherwise>
  848. </xsl:choose>
  849. </title>
  850. <contents>
  851. <xsl:apply-templates select="contents/*">
  852. <xsl:with-param name="posId">
  853. <xsl:value-of select="concat($crosstabNodeMemberId, 'contents')"/>
  854. </xsl:with-param>
  855. <xsl:with-param name="conditional">
  856. <xsl:value-of select="$conditional"/>
  857. </xsl:with-param>
  858. </xsl:apply-templates>
  859. </contents>
  860. </member>
  861. </xsl:template>
  862. <xsl:template match="crosstabSpacer">
  863. <xsl:param name="posId"/>
  864. <xsl:param name="conditional"/>
  865. <xsl:variable name="crosstabSpacerId">
  866. <xsl:value-of select="concat($posId,'/crosstabSpacer')"/>
  867. </xsl:variable>
  868. <member>
  869. <title>
  870. <xsl:variable name="staticValue" select="contents/textItem/dataSource/staticValue"/>
  871. <xsl:choose>
  872. <xsl:when test="$staticValue">
  873. <xsl:value-of select="$staticValue"/>
  874. </xsl:when>
  875. <xsl:otherwise>
  876. <xsl:value-of select="@refDataItem"/>
  877. </xsl:otherwise>
  878. </xsl:choose>
  879. </title>
  880. <contents>
  881. <xsl:apply-templates select="contents/*">
  882. <xsl:with-param name="posId">
  883. <xsl:value-of select="concat($crosstabSpacerId, 'contents')"/>
  884. </xsl:with-param>
  885. <xsl:with-param name="conditional">
  886. <xsl:value-of select="$conditional"/>
  887. </xsl:with-param>
  888. </xsl:apply-templates>
  889. </contents>
  890. </member>
  891. </xsl:template>
  892. <xsl:template match="repeaterTable">
  893. <xsl:param name="posId"/>
  894. <xsl:param name="conditional"/>
  895. <xsl:variable name="countType">
  896. <xsl:value-of select="count(../repeaterTable)"/>
  897. </xsl:variable>
  898. <xsl:variable name="index">
  899. <xsl:value-of select="1 + count(preceding-sibling::repeaterTable)"/>
  900. </xsl:variable>
  901. <xsl:variable name="rptId">
  902. <xsl:choose>
  903. <xsl:when test="$countType &gt; 1">
  904. <xsl:value-of select="concat($posId,'/repeaterTable[',$index,']')"/>
  905. </xsl:when>
  906. <xsl:otherwise>
  907. <xsl:value-of select="concat($posId,'/repeaterTable')"/>
  908. </xsl:otherwise>
  909. </xsl:choose>
  910. </xsl:variable>
  911. <item>
  912. <posId>
  913. <xsl:value-of select="$rptId"/>
  914. </posId>
  915. <conditional>
  916. <xsl:choose>
  917. <xsl:when test="./conditionalRender">true</xsl:when>
  918. <xsl:otherwise>
  919. <xsl:value-of select="$conditional"/>
  920. </xsl:otherwise>
  921. </xsl:choose>
  922. </conditional>
  923. <MRepeaterTable>
  924. <xsl:if test="@name">
  925. <rdsCM:id>
  926. <xsl:value-of select="@name"/>
  927. </rdsCM:id>
  928. </xsl:if>
  929. <pref_columns>
  930. <xsl:value-of select="@across"/>
  931. </pref_columns>
  932. <pref_rows>
  933. <xsl:value-of select="@down"/>
  934. </pref_rows>
  935. <xsl:apply-templates select="repeaterTableCell/contents/*">
  936. <xsl:with-param name="posId">
  937. <xsl:value-of select="concat($rptId, '/repeaterTableCell/contents')"/>
  938. </xsl:with-param>
  939. <xsl:with-param name="conditional">
  940. <xsl:value-of select="$conditional"/>
  941. </xsl:with-param>
  942. </xsl:apply-templates>
  943. </MRepeaterTable>
  944. </item>
  945. </xsl:template>
  946. <xsl:template match="repeater">
  947. <xsl:param name="posId"/>
  948. <xsl:param name="conditional"/>
  949. <xsl:variable name="countType">
  950. <xsl:value-of select="count(../repeater)"/>
  951. </xsl:variable>
  952. <xsl:variable name="index">
  953. <xsl:value-of select="1 + count(preceding-sibling::repeater)"/>
  954. </xsl:variable>
  955. <xsl:variable name="rptId">
  956. <xsl:choose>
  957. <xsl:when test="$countType &gt; 1">
  958. <xsl:value-of select="concat($posId,'/repeater[',$index,']')"/>
  959. </xsl:when>
  960. <xsl:otherwise>
  961. <xsl:value-of select="concat($posId,'/repeater')"/>
  962. </xsl:otherwise>
  963. </xsl:choose>
  964. </xsl:variable>
  965. <item>
  966. <posId>
  967. <xsl:value-of select="$rptId"/>
  968. </posId>
  969. <conditional>
  970. <xsl:choose>
  971. <xsl:when test="./conditionalRender">true</xsl:when>
  972. <xsl:otherwise>
  973. <xsl:value-of select="$conditional"/>
  974. </xsl:otherwise>
  975. </xsl:choose>
  976. </conditional>
  977. <MRepeater>
  978. <xsl:if test="@name">
  979. <rdsCM:id>
  980. <xsl:value-of select="@name"/>
  981. </rdsCM:id>
  982. </xsl:if>
  983. <xsl:apply-templates select="contents/*">
  984. <xsl:with-param name="posId">
  985. <xsl:value-of select="concat($rptId, '/contents')"/>
  986. </xsl:with-param>
  987. <xsl:with-param name="conditional">
  988. <xsl:value-of select="$conditional"/>
  989. </xsl:with-param>
  990. </xsl:apply-templates>
  991. </MRepeater>
  992. </item>
  993. </xsl:template>
  994. <xsl:template match="hyperlink">
  995. <xsl:param name="posId"/>
  996. <xsl:param name="conditional"/>
  997. <xsl:variable name="countType">
  998. <xsl:value-of select="count(../hyperlink)"/>
  999. </xsl:variable>
  1000. <xsl:variable name="index">
  1001. <xsl:value-of select="1 + count(preceding-sibling::hyperlink)"/>
  1002. </xsl:variable>
  1003. <item>
  1004. <posId>
  1005. <xsl:choose>
  1006. <xsl:when test="$countType &gt; 1">
  1007. <xsl:value-of select="concat($posId,'/hyperlink[',$index,']')"/>
  1008. </xsl:when>
  1009. <xsl:otherwise>
  1010. <xsl:value-of select="concat($posId,'/hyperlink')"/>
  1011. </xsl:otherwise>
  1012. </xsl:choose>
  1013. </posId>
  1014. <conditional>
  1015. <xsl:choose>
  1016. <xsl:when test="./conditionalRender">true</xsl:when>
  1017. <xsl:otherwise>
  1018. <xsl:value-of select="$conditional"/>
  1019. </xsl:otherwise>
  1020. </xsl:choose>
  1021. </conditional>
  1022. <MHyperlink>
  1023. <xsl:if test="@name">
  1024. <rdsCM:id>
  1025. <xsl:value-of select="@name"/>
  1026. </rdsCM:id>
  1027. </xsl:if>
  1028. </MHyperlink>
  1029. </item>
  1030. </xsl:template>
  1031. <xsl:template match="button">
  1032. <!--Not yet handled-->
  1033. </xsl:template>
  1034. <xsl:template match="promptButton">
  1035. <!--Not yet handled-->
  1036. </xsl:template>
  1037. <xsl:template match="HTMLItem">
  1038. <xsl:param name="posId"/>
  1039. <xsl:param name="conditional"/>
  1040. <xsl:variable name="countType">
  1041. <xsl:value-of select="count(../HTMLItem)"/>
  1042. </xsl:variable>
  1043. <xsl:variable name="index">
  1044. <xsl:value-of select="1 + count(preceding-sibling::HTMLItem)"/>
  1045. </xsl:variable>
  1046. <item>
  1047. <posId>
  1048. <xsl:choose>
  1049. <xsl:when test="$countType &gt; 1">
  1050. <xsl:value-of select="concat($posId,'/HTMLItem[',$index,']')"/>
  1051. </xsl:when>
  1052. <xsl:otherwise>
  1053. <xsl:value-of select="concat($posId,'/HTMLItem')"/>
  1054. </xsl:otherwise>
  1055. </xsl:choose>
  1056. </posId>
  1057. <conditional>
  1058. <xsl:choose>
  1059. <xsl:when test="./conditionalRender">true</xsl:when>
  1060. <xsl:otherwise>
  1061. <xsl:value-of select="$conditional"/>
  1062. </xsl:otherwise>
  1063. </xsl:choose>
  1064. </conditional>
  1065. <MHTML>
  1066. <xsl:if test="@name">
  1067. <rdsCM:id>
  1068. <xsl:value-of select="@name"/>
  1069. </rdsCM:id>
  1070. </xsl:if>
  1071. </MHTML>
  1072. </item>
  1073. </xsl:template>
  1074. <xsl:template match="richTextItem">
  1075. <xsl:param name="posId"/>
  1076. <xsl:param name="conditional"/>
  1077. <xsl:variable name="countType">
  1078. <xsl:value-of select="count(../richTextItem)"/>
  1079. </xsl:variable>
  1080. <xsl:variable name="index">
  1081. <xsl:value-of select="1 + count(preceding-sibling::richTextItem)"/>
  1082. </xsl:variable>
  1083. <item>
  1084. <posId>
  1085. <xsl:choose>
  1086. <xsl:when test="$countType &gt; 1">
  1087. <xsl:value-of select="concat($posId,'/richTextItem[',$index,']')"/>
  1088. </xsl:when>
  1089. <xsl:otherwise>
  1090. <xsl:value-of select="concat($posId,'/richTextItem')"/>
  1091. </xsl:otherwise>
  1092. </xsl:choose>
  1093. </posId>
  1094. <conditional>
  1095. <xsl:choose>
  1096. <xsl:when test="./conditionalRender">true</xsl:when>
  1097. <xsl:otherwise>
  1098. <xsl:value-of select="$conditional"/>
  1099. </xsl:otherwise>
  1100. </xsl:choose>
  1101. </conditional>
  1102. <MRichText>
  1103. <xsl:if test="@name">
  1104. <rdsCM:id>
  1105. <xsl:value-of select="@name"/>
  1106. </rdsCM:id>
  1107. </xsl:if>
  1108. </MRichText>
  1109. </item>
  1110. </xsl:template>
  1111. <xsl:template match="bookmark">
  1112. <xsl:param name="posId"/>
  1113. <xsl:param name="conditional"/>
  1114. <xsl:variable name="countType">
  1115. <xsl:value-of select="count(../bookmark)"/>
  1116. </xsl:variable>
  1117. <xsl:variable name="index">
  1118. <xsl:value-of select="1 + count(preceding-sibling::bookmark)"/>
  1119. </xsl:variable>
  1120. <item>
  1121. <posId>
  1122. <xsl:choose>
  1123. <xsl:when test="$countType &gt; 1">
  1124. <xsl:value-of select="concat($posId,'/bookmark[',$index,']')"/>
  1125. </xsl:when>
  1126. <xsl:otherwise>
  1127. <xsl:value-of select="concat($posId,'/bookmark')"/>
  1128. </xsl:otherwise>
  1129. </xsl:choose>
  1130. </posId>
  1131. <conditional>
  1132. <xsl:choose>
  1133. <xsl:when test="./conditionalRender">true</xsl:when>
  1134. <xsl:otherwise>
  1135. <xsl:value-of select="$conditional"/>
  1136. </xsl:otherwise>
  1137. </xsl:choose>
  1138. </conditional>
  1139. <MBookmark>
  1140. <xsl:choose>
  1141. <xsl:when test="@name">
  1142. <rdsCM:id>
  1143. <xsl:value-of select="@name"/>
  1144. </rdsCM:id>
  1145. </xsl:when>
  1146. <xsl:otherwise>
  1147. <xsl:if test="dataSource/staticValue">
  1148. <rdsCM:id>
  1149. <xsl:value-of select="dataSource/staticValue"/>
  1150. </rdsCM:id>
  1151. </xsl:if>
  1152. </xsl:otherwise>
  1153. </xsl:choose>
  1154. </MBookmark>
  1155. </item>
  1156. </xsl:template>
  1157. <xsl:template match="TOCEntry">
  1158. <xsl:param name="posId"/>
  1159. <xsl:param name="conditional"/>
  1160. <xsl:variable name="countType">
  1161. <xsl:value-of select="count(../TOCEntry)"/>
  1162. </xsl:variable>
  1163. <xsl:variable name="index">
  1164. <xsl:value-of select="1 + count(preceding-sibling::TOCEntry)"/>
  1165. </xsl:variable>
  1166. <item>
  1167. <posId>
  1168. <xsl:choose>
  1169. <xsl:when test="$countType &gt; 1">
  1170. <xsl:value-of select="concat($posId,'/TOCEntry[',$index,']')"/>
  1171. </xsl:when>
  1172. <xsl:otherwise>
  1173. <xsl:value-of select="concat($posId,'/TOCEntry')"/>
  1174. </xsl:otherwise>
  1175. </xsl:choose>
  1176. </posId>
  1177. <!-- TOCEntry items are also mapped to bookmark object -->
  1178. <!-- Note: neither TOCEntry nor bookmark have name attrbitues, so id will be empty -->
  1179. <conditional>
  1180. <xsl:choose>
  1181. <xsl:when test="./conditionalRender">true</xsl:when>
  1182. <xsl:otherwise>
  1183. <xsl:value-of select="$conditional"/>
  1184. </xsl:otherwise>
  1185. </xsl:choose>
  1186. </conditional>
  1187. <MBookmark>
  1188. <xsl:if test="@name">
  1189. <rdsCM:id>
  1190. <xsl:value-of select="@name"/>
  1191. </rdsCM:id>
  1192. </xsl:if>
  1193. </MBookmark>
  1194. </item>
  1195. </xsl:template>
  1196. <xsl:template match="fieldSet">
  1197. <xsl:param name="posId"/>
  1198. <xsl:param name="conditional"/>
  1199. <xsl:variable name="countType">
  1200. <xsl:value-of select="count(../fieldset)"/>
  1201. </xsl:variable>
  1202. <xsl:variable name="index">
  1203. <xsl:value-of select="1 + count(preceding-sibling::fieldset)"/>
  1204. </xsl:variable>
  1205. <xsl:apply-templates select="fieldSetCaption/contents/*">
  1206. <xsl:with-param name="posId">
  1207. <xsl:choose>
  1208. <xsl:when test="$countType &gt; 1">
  1209. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption[',$index,']/contents')"/>
  1210. </xsl:when>
  1211. <xsl:otherwise>
  1212. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption/contents')"/>
  1213. </xsl:otherwise>
  1214. </xsl:choose>
  1215. </xsl:with-param>
  1216. <xsl:with-param name="conditional">
  1217. <xsl:value-of select="$conditional"/>
  1218. </xsl:with-param>
  1219. </xsl:apply-templates>
  1220. <xsl:apply-templates select="contents/*">
  1221. <xsl:with-param name="posId">
  1222. <xsl:choose>
  1223. <xsl:when test="$countType &gt; 1">
  1224. <xsl:value-of select="concat($posId,'/fieldSet[',$index,']/contents')"/>
  1225. </xsl:when>
  1226. <xsl:otherwise>
  1227. <xsl:value-of select="concat($posId,'/fieldSet/contents')"/>
  1228. </xsl:otherwise>
  1229. </xsl:choose>
  1230. </xsl:with-param>
  1231. <xsl:with-param name="conditional">
  1232. <xsl:value-of select="$conditional"/>
  1233. </xsl:with-param>
  1234. </xsl:apply-templates>
  1235. </xsl:template>
  1236. <xsl:template match="conditionalBlocks">
  1237. <xsl:param name="posId"/>
  1238. <xsl:variable name="countType">
  1239. <xsl:value-of select="count(../conditionalBlocks)"/>
  1240. </xsl:variable>
  1241. <xsl:variable name="index">
  1242. <xsl:value-of select="1 + count(preceding-sibling::conditionalBlocks)"/>
  1243. </xsl:variable>
  1244. <xsl:apply-templates select="./conditionalBlockDefault/contents/*">
  1245. <xsl:with-param name="posId">
  1246. <xsl:value-of select="concat($posId,'/conditionalBlockDefault/contents')"/>
  1247. </xsl:with-param>
  1248. <xsl:with-param name="conditional">true</xsl:with-param>
  1249. </xsl:apply-templates>
  1250. <xsl:for-each select="./conditionalBlockCases/conditionalBlock">
  1251. <xsl:apply-templates select="./contents/*">
  1252. <xsl:with-param name="posId">
  1253. <xsl:choose>
  1254. <xsl:when test="count(../conditionalBlock) &gt; 1">
  1255. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock[',1 + count(preceding-sibling::conditionalBlock),']/contents')"/>
  1256. </xsl:when>
  1257. <xsl:otherwise>
  1258. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock/contents')"/>
  1259. </xsl:otherwise>
  1260. </xsl:choose>
  1261. </xsl:with-param>
  1262. <xsl:with-param name="conditional">true</xsl:with-param>
  1263. </xsl:apply-templates>
  1264. </xsl:for-each>
  1265. </xsl:template>
  1266. <xsl:template match="layoutComponentRef">
  1267. <xsl:param name="conditional"/>
  1268. <xsl:param name="posId"/>
  1269. <xsl:variable name="countType">
  1270. <xsl:value-of select="count(../layoutComponentRef)"/>
  1271. </xsl:variable>
  1272. <xsl:variable name="index">
  1273. <xsl:value-of select="1 + count(preceding-sibling::layoutComponentRef)"/>
  1274. </xsl:variable>
  1275. <!-- LCR will be handled in next version -->
  1276. </xsl:template>
  1277. <xsl:template match="CMMMap">
  1278. <xsl:param name="posId"/>
  1279. <xsl:param name="conditional"/>
  1280. <xsl:variable name="countType">
  1281. <xsl:value-of select="count(../CMMMap)"/>
  1282. </xsl:variable>
  1283. <xsl:variable name="index">
  1284. <xsl:value-of select="1 + count(preceding-sibling::CMMMap)"/>
  1285. </xsl:variable>
  1286. <item>
  1287. <posId>
  1288. <xsl:choose>
  1289. <xsl:when test="$countType &gt; 1">
  1290. <xsl:value-of select="concat($posId,'/CMMMap[',$index,']')"/>
  1291. </xsl:when>
  1292. <xsl:otherwise>
  1293. <xsl:value-of select="concat($posId,'/CMMMap')"/>
  1294. </xsl:otherwise>
  1295. </xsl:choose>
  1296. </posId>
  1297. <conditional>
  1298. <xsl:choose>
  1299. <xsl:when test="./conditionalRender">true</xsl:when>
  1300. <xsl:otherwise>
  1301. <xsl:value-of select="$conditional"/>
  1302. </xsl:otherwise>
  1303. </xsl:choose>
  1304. </conditional>
  1305. <MImage>
  1306. <xsl:if test="@cmmID">
  1307. <rdsCM:id>
  1308. <xsl:value-of select="@cmmID"/>
  1309. </rdsCM:id>
  1310. </xsl:if>
  1311. </MImage>
  1312. </item>
  1313. </xsl:template>
  1314. <xsl:template match="asOfTime">
  1315. <!--Not yet handled-->
  1316. </xsl:template>
  1317. <xsl:template match="pieChart | paretoChart | scatterChart | polarChart | radarChart | progressiveChart | combinationChart | bubbleChart | threeDCombinationChart | threeDScatterChart | gaugeChart | mapChart | metricsChart | marimekkoChart | winLossChart | v2_combinationChart | v2_scatterChart | v2_pieChart | v2_gaugeChart | v2_matrixChart | v2_progressiveChart | v2_paretoChart | v2_bubbleChart | v2_repeaterChart | v2_bulletChart ">
  1318. <xsl:param name="posId"/>
  1319. <xsl:param name="conditional"/>
  1320. <item>
  1321. <posId>
  1322. <xsl:choose>
  1323. <xsl:when test="name() = 'pieChart'">
  1324. <xsl:choose>
  1325. <xsl:when test="count(../pieChart) &gt; 1">
  1326. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::pieChart),']')"/>
  1327. </xsl:when>
  1328. <xsl:otherwise>
  1329. <xsl:value-of select="concat($posId,'/pieChart')"/>
  1330. </xsl:otherwise>
  1331. </xsl:choose>
  1332. </xsl:when>
  1333. <xsl:when test="name() = 'paretoChart'">
  1334. <xsl:choose>
  1335. <xsl:when test="count(../paretoChart) &gt; 1">
  1336. <xsl:value-of select="concat($posId,'/paretoChart[',1 + count(preceding-sibling::paretoChart),']')"/>
  1337. </xsl:when>
  1338. <xsl:otherwise>
  1339. <xsl:value-of select="concat($posId,'/paretoChart')"/>
  1340. </xsl:otherwise>
  1341. </xsl:choose>
  1342. </xsl:when>
  1343. <xsl:when test="name() = 'scatterChart'">
  1344. <xsl:choose>
  1345. <xsl:when test="count(../scatterChart) &gt; 1">
  1346. <xsl:value-of select="concat($posId,'/scatterChart[',1 + count(preceding-sibling::scatterChart),']')"/>
  1347. </xsl:when>
  1348. <xsl:otherwise>
  1349. <xsl:value-of select="concat($posId,'/scatterChart')"/>
  1350. </xsl:otherwise>
  1351. </xsl:choose>
  1352. </xsl:when>
  1353. <xsl:when test="name() = 'polarChart'">
  1354. <xsl:choose>
  1355. <xsl:when test="count(../polarChart) &gt; 1">
  1356. <xsl:value-of select="concat($posId,'/polarChart[',1 + count(preceding-sibling::polarChart),']')"/>
  1357. </xsl:when>
  1358. <xsl:otherwise>
  1359. <xsl:value-of select="concat($posId,'/polarChart')"/>
  1360. </xsl:otherwise>
  1361. </xsl:choose>
  1362. </xsl:when>
  1363. <xsl:when test="name() = 'radarChart'">
  1364. <xsl:choose>
  1365. <xsl:when test="count(../radarChart) &gt; 1">
  1366. <xsl:value-of select="concat($posId,'/radarChart[',1 + count(preceding-sibling::radarChart),']')"/>
  1367. </xsl:when>
  1368. <xsl:otherwise>
  1369. <xsl:value-of select="concat($posId,'/radarChart')"/>
  1370. </xsl:otherwise>
  1371. </xsl:choose>
  1372. </xsl:when>
  1373. <xsl:when test="name() = 'progressiveChart'">
  1374. <xsl:choose>
  1375. <xsl:when test="count(../progressiveChart) &gt; 1">
  1376. <xsl:value-of select="concat($posId,'/progressiveChart[',1 + count(preceding-sibling::progressiveChart),']')"/>
  1377. </xsl:when>
  1378. <xsl:otherwise>
  1379. <xsl:value-of select="concat($posId,'/progressiveChart')"/>
  1380. </xsl:otherwise>
  1381. </xsl:choose>
  1382. </xsl:when>
  1383. <xsl:when test="name() = 'combinationChart'">
  1384. <xsl:choose>
  1385. <xsl:when test="count(../combinationChart) &gt; 1">
  1386. <xsl:value-of select="concat($posId,'/combinationChart[',1 + count(preceding-sibling::combinationChart),']')"/>
  1387. </xsl:when>
  1388. <xsl:otherwise>
  1389. <xsl:value-of select="concat($posId,'/combinationChart')"/>
  1390. </xsl:otherwise>
  1391. </xsl:choose>
  1392. </xsl:when>
  1393. <xsl:when test="name() = 'bubbleChart'">
  1394. <xsl:choose>
  1395. <xsl:when test="count(../bubbleChart) &gt; 1">
  1396. <xsl:value-of select="concat($posId,'/bubbleChart[',1 + count(preceding-sibling::bubbleChart),']')"/>
  1397. </xsl:when>
  1398. <xsl:otherwise>
  1399. <xsl:value-of select="concat($posId,'/bubbleChart')"/>
  1400. </xsl:otherwise>
  1401. </xsl:choose>
  1402. </xsl:when>
  1403. <xsl:when test="name() = 'threeDCombinationChart'">
  1404. <xsl:choose>
  1405. <xsl:when test="count(../threeDCombinationChart) &gt; 1">
  1406. <xsl:value-of select="concat($posId,'/threeDCombinationChart[',1 + count(preceding-sibling::threeDCombinationChart),']')"/>
  1407. </xsl:when>
  1408. <xsl:otherwise>
  1409. <xsl:value-of select="concat($posId,'/threeDCombinationChart')"/>
  1410. </xsl:otherwise>
  1411. </xsl:choose>
  1412. </xsl:when>
  1413. <xsl:when test="name() = 'threeDScatterChart'">
  1414. <xsl:choose>
  1415. <xsl:when test="count(../threeDScatterChart) &gt; 1">
  1416. <xsl:value-of select="concat($posId,'/threeDScatterChart[',1 + count(preceding-sibling::threeDScatterChart),']')"/>
  1417. </xsl:when>
  1418. <xsl:otherwise>
  1419. <xsl:value-of select="concat($posId,'/threeDScatterChart')"/>
  1420. </xsl:otherwise>
  1421. </xsl:choose>
  1422. </xsl:when>
  1423. <xsl:when test="name() = 'gaugeChart'">
  1424. <xsl:choose>
  1425. <xsl:when test="count(../gaugeChart) &gt; 1">
  1426. <xsl:value-of select="concat($posId,'/gaugeChart[',1 + count(preceding-sibling::gaugeChart),']')"/>
  1427. </xsl:when>
  1428. <xsl:otherwise>
  1429. <xsl:value-of select="concat($posId,'/gaugeChart')"/>
  1430. </xsl:otherwise>
  1431. </xsl:choose>
  1432. </xsl:when>
  1433. <xsl:when test="name() = 'mapChart'">
  1434. <xsl:choose>
  1435. <xsl:when test="count(../mapChart) &gt; 1">
  1436. <xsl:value-of select="concat($posId,'/mapChart[',1 + count(preceding-sibling::mapChart),']')"/>
  1437. </xsl:when>
  1438. <xsl:otherwise>
  1439. <xsl:value-of select="concat($posId,'/mapChart')"/>
  1440. </xsl:otherwise>
  1441. </xsl:choose>
  1442. </xsl:when>
  1443. <xsl:when test="name() = 'metricsChart'">
  1444. <xsl:choose>
  1445. <xsl:when test="count(../metricsChart) &gt; 1">
  1446. <xsl:value-of select="concat($posId,'/metricsChart[',1 + count(preceding-sibling::metricsChart),']')"/>
  1447. </xsl:when>
  1448. <xsl:otherwise>
  1449. <xsl:value-of select="concat($posId,'/metricsChart')"/>
  1450. </xsl:otherwise>
  1451. </xsl:choose>
  1452. </xsl:when>
  1453. <xsl:when test="name() = 'marimekkoChart'">
  1454. <xsl:choose>
  1455. <xsl:when test="count(../marimekkoChart) &gt; 1">
  1456. <xsl:value-of select="concat($posId,'/marimekkoChart[',1 + count(preceding-sibling::marimekkoChart),']')"/>
  1457. </xsl:when>
  1458. <xsl:otherwise>
  1459. <xsl:value-of select="concat($posId,'/marimekkoChart')"/>
  1460. </xsl:otherwise>
  1461. </xsl:choose>
  1462. </xsl:when>
  1463. <xsl:when test="name() = 'winLossChart'">
  1464. <xsl:choose>
  1465. <xsl:when test="count(../winLossChart) &gt; 1">
  1466. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::winLossChart),']')"/>
  1467. </xsl:when>
  1468. <xsl:otherwise>
  1469. <xsl:value-of select="concat($posId,'/winLossChart')"/>
  1470. </xsl:otherwise>
  1471. </xsl:choose>
  1472. </xsl:when>
  1473. <xsl:when test="name() = 'v2_combinationChart'">
  1474. <xsl:choose>
  1475. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1476. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::v2_combinationChart),']')"/>
  1477. </xsl:when>
  1478. <xsl:otherwise>
  1479. <xsl:value-of select="concat($posId,'/v2_combinationChart')"/>
  1480. </xsl:otherwise>
  1481. </xsl:choose>
  1482. </xsl:when>
  1483. <xsl:when test="name() = 'v2_scatterChart'">
  1484. <xsl:choose>
  1485. <xsl:when test="count(../v2_scatterChart) &gt; 1">
  1486. <xsl:value-of select="concat($posId,'/v2_scatterChart[',1 + count(preceding-sibling::v2_scatterChart),']')"/>
  1487. </xsl:when>
  1488. <xsl:otherwise>
  1489. <xsl:value-of select="concat($posId,'/v2_schatterChart')"/>
  1490. </xsl:otherwise>
  1491. </xsl:choose>
  1492. </xsl:when>
  1493. <xsl:when test="name() = 'v2_pieChart'">
  1494. <xsl:choose>
  1495. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1496. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::v2_pieChart),']')"/>
  1497. </xsl:when>
  1498. <xsl:otherwise>
  1499. <xsl:value-of select="concat($posId,'/v2_pieChart')"/>
  1500. </xsl:otherwise>
  1501. </xsl:choose>
  1502. </xsl:when>
  1503. <xsl:when test="name() = 'v2_guageChart'">
  1504. <xsl:choose>
  1505. <xsl:when test="count(../v2_guageChart) &gt; 1">
  1506. <xsl:value-of select="concat($posId,'/v2_guageChart[',1 + count(preceding-sibling::v2_guageChart),']')"/>
  1507. </xsl:when>
  1508. <xsl:otherwise>
  1509. <xsl:value-of select="concat($posId,'/v2_guageChart')"/>
  1510. </xsl:otherwise>
  1511. </xsl:choose>
  1512. </xsl:when>
  1513. <xsl:when test="name() = 'v2_matrixChart'">
  1514. <xsl:choose>
  1515. <xsl:when test="count(../v2_matrixChart) &gt; 1">
  1516. <xsl:value-of select="concat($posId,'/v2_matrixChart[',1 + count(preceding-sibling::v2_matrixChart),']')"/>
  1517. </xsl:when>
  1518. <xsl:otherwise>
  1519. <xsl:value-of select="concat($posId,'/v2_matrixChart')"/>
  1520. </xsl:otherwise>
  1521. </xsl:choose>
  1522. </xsl:when>
  1523. <xsl:when test="name() = 'v2_progressiveChart'">
  1524. <xsl:choose>
  1525. <xsl:when test="count(../v2_progressiveChart) &gt; 1">
  1526. <xsl:value-of select="concat($posId,'/v2_progressiveChart[',1 + count(preceding-sibling::v2_progressiveChart),']')"/>
  1527. </xsl:when>
  1528. <xsl:otherwise>
  1529. <xsl:value-of select="concat($posId,'/v2_progressiveChart')"/>
  1530. </xsl:otherwise>
  1531. </xsl:choose>
  1532. </xsl:when>
  1533. <xsl:when test="name() = 'v2_paretoChart'">
  1534. <xsl:choose>
  1535. <xsl:when test="count(../v2_paretoChart) &gt; 1">
  1536. <xsl:value-of select="concat($posId,'/v2_paretoChart[',1 + count(preceding-sibling::v2_paretoChart),']')"/>
  1537. </xsl:when>
  1538. <xsl:otherwise>
  1539. <xsl:value-of select="concat($posId,'/v2_paretoChart')"/>
  1540. </xsl:otherwise>
  1541. </xsl:choose>
  1542. </xsl:when>
  1543. <xsl:when test="name() = 'v2_bubbleChart'">
  1544. <xsl:choose>
  1545. <xsl:when test="count(../v2_bubbleChart) &gt; 1">
  1546. <xsl:value-of select="concat($posId,'/v2_bubbleChart[',1 + count(preceding-sibling::v2_bubbleChart),']')"/>
  1547. </xsl:when>
  1548. <xsl:otherwise>
  1549. <xsl:value-of select="concat($posId,'/v2_bubbleChart')"/>
  1550. </xsl:otherwise>
  1551. </xsl:choose>
  1552. </xsl:when>
  1553. <xsl:when test="name() = 'v2_repeaterChart'">
  1554. <xsl:choose>
  1555. <xsl:when test="count(../v2_repeaterChart) &gt; 1">
  1556. <xsl:value-of select="concat($posId,'/v2_repeaterChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1557. </xsl:when>
  1558. <xsl:otherwise>
  1559. <xsl:value-of select="concat($posId,'/v2_repeaterChart')"/>
  1560. </xsl:otherwise>
  1561. </xsl:choose>
  1562. </xsl:when>
  1563. <xsl:when test="name() = 'v2_bulletChart'">
  1564. <xsl:choose>
  1565. <xsl:when test="count(../v2_bulletChart) &gt; 1">
  1566. <xsl:value-of select="concat($posId,'/v2_bulletChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1567. </xsl:when>
  1568. <xsl:otherwise>
  1569. <xsl:value-of select="concat($posId,'/v2_bulletChart')"/>
  1570. </xsl:otherwise>
  1571. </xsl:choose>
  1572. </xsl:when>
  1573. <xsl:otherwise>
  1574. <xsl:value-of select="concat($posId,'/unknownChartType')"/>
  1575. </xsl:otherwise>
  1576. </xsl:choose>
  1577. </posId>
  1578. <conditional>
  1579. <xsl:choose>
  1580. <xsl:when test="./conditionalRender">true</xsl:when>
  1581. <xsl:otherwise>
  1582. <xsl:value-of select="$conditional"/>
  1583. </xsl:otherwise>
  1584. </xsl:choose>
  1585. </conditional>
  1586. <MChart>
  1587. <xsl:if test="@name">
  1588. <rdsCM:id>
  1589. <xsl:value-of select="@name"/>
  1590. </rdsCM:id>
  1591. </xsl:if>
  1592. </MChart>
  1593. </item>
  1594. </xsl:template>
  1595. <xsl:template match="singleton">
  1596. <xsl:param name="posId"/>
  1597. <xsl:param name="conditional"/>
  1598. <xsl:variable name="countType">
  1599. <xsl:value-of select="count(../singleton)"/>
  1600. </xsl:variable>
  1601. <xsl:variable name="index">
  1602. <xsl:value-of select="1 + count(preceding-sibling::singleton)"/>
  1603. </xsl:variable>
  1604. <xsl:apply-templates select="contents/*">
  1605. <xsl:with-param name="posId">
  1606. <xsl:choose>
  1607. <xsl:when test="$countType &gt; 1">
  1608. <xsl:value-of select="concat($posId,'/singleton[',$index,']/contents')"/>
  1609. </xsl:when>
  1610. <xsl:otherwise>
  1611. <xsl:value-of select="concat($posId,'/singleton/contents')"/>
  1612. </xsl:otherwise>
  1613. </xsl:choose>
  1614. </xsl:with-param>
  1615. <xsl:with-param name="conditional">
  1616. <xsl:value-of select="$conditional"/>
  1617. </xsl:with-param>
  1618. </xsl:apply-templates>
  1619. </xsl:template>
  1620. <xsl:template match="*">
  1621. <!--Unknown element. Ignore-->
  1622. </xsl:template>
  1623. </xsl:stylesheet>