meta.xsl 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677
  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, 2013
  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/2" xmlns:ccs="com.cognos.ccs.xslt.XSLTFunctions" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ldx="http://www.ibm.com/xmlns/prod/cognos/layoutData/200904">
  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. <ldx:id>
  29. <xsl:value-of select="@name"/>
  30. </ldx: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. <ldx:id>
  106. <xsl:value-of select="concat('children(', pageSections/pageSection/pageSectionDefinition/dmMembers/dmMember/itemCaption, ')')"/>
  107. </ldx:id>
  108. </xsl:when>
  109. <xsl:otherwise>
  110. <ldx:id>
  111. <xsl:value-of select="concat(pageSections/pageSection/dmHierarchy/itemCaption, ' (list)')"/>
  112. </ldx: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</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. <ldx:id>
  187. <xsl:value-of select="@refDataItem"/>
  188. </ldx: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,'/detailPages[',$index,']')"/>
  210. </xsl:when>
  211. <xsl:otherwise>
  212. <xsl:value-of select="concat($posId,'/detailPages')"/>
  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. <ldx:id>
  384. <xsl:value-of select="@name"/>
  385. </ldx: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,'/listGroup/list[',$index,']')"/>
  505. </xsl:when>
  506. <xsl:otherwise>
  507. <xsl:value-of select="concat($posId,'/listGroup')"/>
  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,'/listRows/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"><xsl:value-of select="concat($posId,'/rowCells/rowCell/contents')"/></xsl:variable>
  577. <xsl:if test="not(contains(style/CSS/@value,'display:none'))">
  578. <rowCell>
  579. <xsl:choose>
  580. <xsl:when test="@colSpan">
  581. <xsl:attribute name="colSpan"><xsl:value-of select="@colSpan"/></xsl:attribute>
  582. </xsl:when>
  583. <xsl:otherwise>
  584. <xsl:attribute name="colSpan">1</xsl:attribute>
  585. </xsl:otherwise>
  586. </xsl:choose>
  587. <xsl:apply-templates select="contents/*">
  588. <xsl:with-param name="posId">
  589. <xsl:value-of select="$rowCellId"/>
  590. </xsl:with-param>
  591. <xsl:with-param name="conditional">
  592. <xsl:value-of select="$conditional"/>
  593. </xsl:with-param>
  594. </xsl:apply-templates>
  595. </rowCell>
  596. </xsl:if>
  597. </xsl:template>
  598. <xsl:template match="TOC">
  599. <xsl:param name="posId"/>
  600. <xsl:param name="conditional"/>
  601. <xsl:variable name="countType">
  602. <xsl:value-of select="count(../TOC)"/>
  603. </xsl:variable>
  604. <xsl:variable name="index">
  605. <xsl:value-of select="1 + count(preceding-sibling::TOC)"/>
  606. </xsl:variable>
  607. <item>
  608. <posId>
  609. <xsl:choose>
  610. <xsl:when test="$countType &gt; 1">
  611. <xsl:value-of select="concat($posId,'/TOC[',$index,']')"/>
  612. </xsl:when>
  613. <xsl:otherwise>
  614. <xsl:value-of select="concat($posId,'/TOC')"/>
  615. </xsl:otherwise>
  616. </xsl:choose>
  617. </posId>
  618. <conditional>
  619. <xsl:choose>
  620. <xsl:when test="./conditionalRender">true</xsl:when>
  621. <xsl:otherwise>
  622. <xsl:value-of select="$conditional"/>
  623. </xsl:otherwise>
  624. </xsl:choose>
  625. </conditional>
  626. <MTableOfContents>
  627. <xsl:if test="@tocName">
  628. <ldx:id>
  629. <xsl:value-of select="@tocName"/>
  630. </ldx:id>
  631. </xsl:if>
  632. </MTableOfContents>
  633. </item>
  634. </xsl:template>
  635. <xsl:template match="textItem">
  636. <xsl:param name="conditional"/>
  637. <xsl:param name="posId"/>
  638. <xsl:variable name="countType">
  639. <xsl:value-of select="count(../textItem)"/>
  640. </xsl:variable>
  641. <xsl:variable name="index">
  642. <xsl:value-of select="1 + count(preceding-sibling::textItem)"/>
  643. </xsl:variable>
  644. <item>
  645. <posId>
  646. <xsl:choose>
  647. <xsl:when test="$countType &gt; 1">
  648. <xsl:value-of select="concat($posId,'/textItem[',$index,']')"/>
  649. </xsl:when>
  650. <xsl:otherwise>
  651. <xsl:value-of select="concat($posId,'/textItem')"/>
  652. </xsl:otherwise>
  653. </xsl:choose>
  654. </posId>
  655. <conditional>
  656. <xsl:choose>
  657. <xsl:when test="./conditionalRender">true</xsl:when>
  658. <xsl:otherwise>
  659. <xsl:value-of select="$conditional"/>
  660. </xsl:otherwise>
  661. </xsl:choose>
  662. </conditional>
  663. <MTextFrame>
  664. <xsl:if test="@name">
  665. <ldx:id>
  666. <xsl:value-of select="@name"/>
  667. </ldx:id>
  668. </xsl:if>
  669. </MTextFrame>
  670. </item>
  671. </xsl:template>
  672. <xsl:template match="image">
  673. <xsl:param name="posId"/>
  674. <xsl:param name="conditional"/>
  675. <xsl:variable name="countType">
  676. <xsl:value-of select="count(../image)"/>
  677. </xsl:variable>
  678. <xsl:variable name="index">
  679. <xsl:value-of select="1 + count(preceding-sibling::image)"/>
  680. </xsl:variable>
  681. <item>
  682. <posId>
  683. <xsl:choose>
  684. <xsl:when test="$countType &gt; 1">
  685. <xsl:value-of select="concat($posId,'/image[',$index,']')"/>
  686. </xsl:when>
  687. <xsl:otherwise>
  688. <xsl:value-of select="concat($posId,'/image')"/>
  689. </xsl:otherwise>
  690. </xsl:choose>
  691. </posId>
  692. <conditional>
  693. <xsl:choose>
  694. <xsl:when test="./conditionalRender">true</xsl:when>
  695. <xsl:otherwise>
  696. <xsl:value-of select="$conditional"/>
  697. </xsl:otherwise>
  698. </xsl:choose>
  699. </conditional>
  700. <MImage>
  701. <xsl:if test="@name">
  702. <ldx:id>
  703. <xsl:value-of select="@name"/>
  704. </ldx:id>
  705. </xsl:if>
  706. </MImage>
  707. </item>
  708. </xsl:template>
  709. <xsl:template match="crosstab">
  710. <xsl:param name="posId"/>
  711. <xsl:param name="conditional"/>
  712. <xsl:variable name="countType">
  713. <xsl:value-of select="count(../crosstab)"/>
  714. </xsl:variable>
  715. <xsl:variable name="index">
  716. <xsl:value-of select="1 + count(preceding-sibling::crosstab)"/>
  717. </xsl:variable>
  718. <item>
  719. <xsl:variable name="xtabId">
  720. <xsl:choose>
  721. <xsl:when test="$countType &gt; 1">
  722. <xsl:value-of select="concat($posId,'/crosstab[',$index,']')"/>
  723. </xsl:when>
  724. <xsl:otherwise>
  725. <xsl:value-of select="concat($posId,'/crosstab')"/>
  726. </xsl:otherwise>
  727. </xsl:choose>
  728. </xsl:variable>
  729. <posId>
  730. <xsl:value-of select="$xtabId"/>
  731. </posId>
  732. <conditional>
  733. <xsl:choose>
  734. <xsl:when test="./conditionalRender">true</xsl:when>
  735. <xsl:otherwise>
  736. <xsl:value-of select="$conditional"/>
  737. </xsl:otherwise>
  738. </xsl:choose>
  739. </conditional>
  740. <MCrossTab>
  741. <xsl:if test="@name">
  742. <ldx:id>
  743. <xsl:choose>
  744. <xsl:when test="function-available('ccs:getInfoPartName')">
  745. <xsl:value-of select="ccs:getInfoPartName(@name,'Crosstab')"/>
  746. </xsl:when>
  747. <xsl:otherwise>
  748. <xsl:value-of select="@name"/>
  749. </xsl:otherwise>
  750. </xsl:choose>
  751. </ldx:id>
  752. <corner>
  753. <xsl:apply-templates select="crosstabCorner/contents/*">
  754. <xsl:with-param name="posId">
  755. <xsl:value-of select="concat($xtabId, '/crosstabCorner/contents')"/>
  756. </xsl:with-param>
  757. <xsl:with-param name="conditional">
  758. <xsl:value-of select="$conditional"/>
  759. </xsl:with-param>
  760. </xsl:apply-templates>
  761. </corner>
  762. <columns>
  763. <xsl:apply-templates select="crosstabColumns/crosstabNode">
  764. <xsl:with-param name="posId">
  765. <xsl:value-of select="concat($xtabId, 'crosstabColumns/crosstabNode')"/>
  766. </xsl:with-param>
  767. <xsl:with-param name="conditional">
  768. <xsl:value-of select="$conditional"/>
  769. </xsl:with-param>
  770. </xsl:apply-templates>
  771. </columns>
  772. <rows>
  773. <xsl:apply-templates select="crosstabRows/crosstabNode">
  774. <xsl:with-param name="posId">
  775. <xsl:value-of select="concat($xtabId, 'crosstabRows/crosstabNode')"/>
  776. </xsl:with-param>
  777. <xsl:with-param name="conditional">
  778. <xsl:value-of select="$conditional"/>
  779. </xsl:with-param>
  780. </xsl:apply-templates>
  781. </rows>
  782. </xsl:if>
  783. </MCrossTab>
  784. </item>
  785. </xsl:template>
  786. <xsl:template match="crosstabNode">
  787. <xsl:param name="posId"/>
  788. <xsl:param name="conditional"/>
  789. <xsl:variable name="crosstabNodeId">
  790. <xsl:value-of select="concat($posId,'/crosstabNestedNodes')"/>
  791. </xsl:variable>
  792. <crosstabNode>
  793. <xsl:apply-templates select="*">
  794. <xsl:with-param name="posId">
  795. <xsl:value-of select="$crosstabNodeId"/>
  796. </xsl:with-param>
  797. <xsl:with-param name="conditional">
  798. <xsl:value-of select="$conditional"/>
  799. </xsl:with-param>
  800. </xsl:apply-templates>
  801. </crosstabNode>
  802. </xsl:template>
  803. <xsl:template match="crosstabNestedNodes">
  804. <xsl:param name="posId"/>
  805. <xsl:param name="conditional"/>
  806. <xsl:variable name="crosstabNestedNodesId">
  807. <xsl:value-of select="concat($posId,'/crosstabNestedNodes')"/>
  808. </xsl:variable>
  809. <nestedNodes>
  810. <xsl:apply-templates select="*">
  811. <xsl:with-param name="posId">
  812. <xsl:value-of select="$crosstabNestedNodesId"/>
  813. </xsl:with-param>
  814. <xsl:with-param name="conditional">
  815. <xsl:value-of select="$conditional"/>
  816. </xsl:with-param>
  817. </xsl:apply-templates>
  818. </nestedNodes>
  819. </xsl:template>
  820. <xsl:template match="crosstabNodeMembers">
  821. <xsl:param name="posId"/>
  822. <xsl:param name="conditional"/>
  823. <xsl:variable name="crosstabNodeMembersId">
  824. <xsl:value-of select="concat($posId,'/crosstabNodeMembers')"/>
  825. </xsl:variable>
  826. <members>
  827. <xsl:apply-templates select="*">
  828. <xsl:with-param name="posId">
  829. <xsl:value-of select="$crosstabNodeMembersId"/>
  830. </xsl:with-param>
  831. <xsl:with-param name="conditional">
  832. <xsl:value-of select="$conditional"/>
  833. </xsl:with-param>
  834. </xsl:apply-templates>
  835. </members>
  836. </xsl:template>
  837. <xsl:template match="crosstabNodeMember">
  838. <xsl:param name="posId"/>
  839. <xsl:param name="conditional"/>
  840. <xsl:variable name="crosstabNodeMemberId">
  841. <xsl:value-of select="concat($posId,'/crosstabNodeMember')"/>
  842. </xsl:variable>
  843. <member>
  844. <title>
  845. <xsl:variable name="staticValue" select="contents/textItem/dataSource/staticValue"/>
  846. <xsl:choose>
  847. <xsl:when test="$staticValue">
  848. <xsl:value-of select="$staticValue"/>
  849. </xsl:when>
  850. <xsl:otherwise>
  851. <xsl:value-of select="@refDataItem"/>
  852. </xsl:otherwise>
  853. </xsl:choose>
  854. </title>
  855. <contents>
  856. <xsl:apply-templates select="contents/*">
  857. <xsl:with-param name="posId">
  858. <xsl:value-of select="concat($crosstabNodeMemberId, 'contents')"/>
  859. </xsl:with-param>
  860. <xsl:with-param name="conditional">
  861. <xsl:value-of select="$conditional"/>
  862. </xsl:with-param>
  863. </xsl:apply-templates>
  864. </contents>
  865. </member>
  866. </xsl:template>
  867. <xsl:template match="crosstabSpacer">
  868. <xsl:param name="posId"/>
  869. <xsl:param name="conditional"/>
  870. <xsl:variable name="crosstabSpacerId">
  871. <xsl:value-of select="concat($posId,'/crosstabSpacer')"/>
  872. </xsl:variable>
  873. <member>
  874. <title>
  875. <xsl:variable name="staticValue" select="contents/textItem/dataSource/staticValue"/>
  876. <xsl:choose>
  877. <xsl:when test="$staticValue">
  878. <xsl:value-of select="$staticValue"/>
  879. </xsl:when>
  880. <xsl:otherwise>
  881. <xsl:value-of select="@refDataItem"/>
  882. </xsl:otherwise>
  883. </xsl:choose>
  884. </title>
  885. <contents>
  886. <xsl:apply-templates select="contents/*">
  887. <xsl:with-param name="posId">
  888. <xsl:value-of select="concat($crosstabSpacerId, 'contents')"/>
  889. </xsl:with-param>
  890. <xsl:with-param name="conditional">
  891. <xsl:value-of select="$conditional"/>
  892. </xsl:with-param>
  893. </xsl:apply-templates>
  894. </contents>
  895. </member>
  896. </xsl:template>
  897. <xsl:template match="repeaterTable">
  898. <xsl:param name="posId"/>
  899. <xsl:param name="conditional"/>
  900. <xsl:variable name="countType">
  901. <xsl:value-of select="count(../repeaterTable)"/>
  902. </xsl:variable>
  903. <xsl:variable name="index">
  904. <xsl:value-of select="1 + count(preceding-sibling::repeaterTable)"/>
  905. </xsl:variable>
  906. <xsl:variable name="rptId">
  907. <xsl:choose>
  908. <xsl:when test="$countType &gt; 1">
  909. <xsl:value-of select="concat($posId,'/repeaterTable[',$index,']')"/>
  910. </xsl:when>
  911. <xsl:otherwise>
  912. <xsl:value-of select="concat($posId,'/repeaterTable')"/>
  913. </xsl:otherwise>
  914. </xsl:choose>
  915. </xsl:variable>
  916. <item>
  917. <posId>
  918. <xsl:value-of select="$rptId"/>
  919. </posId>
  920. <conditional>
  921. <xsl:choose>
  922. <xsl:when test="./conditionalRender">true</xsl:when>
  923. <xsl:otherwise>
  924. <xsl:value-of select="$conditional"/>
  925. </xsl:otherwise>
  926. </xsl:choose>
  927. </conditional>
  928. <MRepeaterTable>
  929. <xsl:if test="@name">
  930. <ldx:id>
  931. <xsl:value-of select="@name"/>
  932. </ldx:id>
  933. </xsl:if>
  934. <pref_columns>
  935. <xsl:value-of select="@across"/>
  936. </pref_columns>
  937. <pref_rows>
  938. <xsl:value-of select="@down"/>
  939. </pref_rows>
  940. <xsl:apply-templates select="repeaterTableCell/contents/*">
  941. <xsl:with-param name="posId">
  942. <xsl:value-of select="concat($rptId, '/repeaterTableCell/contents')"/>
  943. </xsl:with-param>
  944. <xsl:with-param name="conditional">
  945. <xsl:value-of select="$conditional"/>
  946. </xsl:with-param>
  947. </xsl:apply-templates>
  948. </MRepeaterTable>
  949. </item>
  950. </xsl:template>
  951. <xsl:template match="repeater">
  952. <xsl:param name="posId"/>
  953. <xsl:param name="conditional"/>
  954. <xsl:variable name="countType">
  955. <xsl:value-of select="count(../repeater)"/>
  956. </xsl:variable>
  957. <xsl:variable name="index">
  958. <xsl:value-of select="1 + count(preceding-sibling::repeater)"/>
  959. </xsl:variable>
  960. <xsl:variable name="rptId">
  961. <xsl:choose>
  962. <xsl:when test="$countType &gt; 1">
  963. <xsl:value-of select="concat($posId,'/repeater[',$index,']')"/>
  964. </xsl:when>
  965. <xsl:otherwise>
  966. <xsl:value-of select="concat($posId,'/repeater')"/>
  967. </xsl:otherwise>
  968. </xsl:choose>
  969. </xsl:variable>
  970. <item>
  971. <posId>
  972. <xsl:value-of select="$rptId"/>
  973. </posId>
  974. <conditional>
  975. <xsl:choose>
  976. <xsl:when test="./conditionalRender">true</xsl:when>
  977. <xsl:otherwise>
  978. <xsl:value-of select="$conditional"/>
  979. </xsl:otherwise>
  980. </xsl:choose>
  981. </conditional>
  982. <MRepeater>
  983. <xsl:if test="@name">
  984. <ldx:id>
  985. <xsl:value-of select="@name"/>
  986. </ldx:id>
  987. </xsl:if>
  988. <xsl:apply-templates select="contents/*">
  989. <xsl:with-param name="posId">
  990. <xsl:value-of select="concat($rptId, '/contents')"/>
  991. </xsl:with-param>
  992. <xsl:with-param name="conditional">
  993. <xsl:value-of select="$conditional"/>
  994. </xsl:with-param>
  995. </xsl:apply-templates>
  996. </MRepeater>
  997. </item>
  998. </xsl:template>
  999. <xsl:template match="hyperlink">
  1000. <xsl:param name="posId"/>
  1001. <xsl:param name="conditional"/>
  1002. <xsl:variable name="countType">
  1003. <xsl:value-of select="count(../hyperlink)"/>
  1004. </xsl:variable>
  1005. <xsl:variable name="index">
  1006. <xsl:value-of select="1 + count(preceding-sibling::hyperlink)"/>
  1007. </xsl:variable>
  1008. <item>
  1009. <posId>
  1010. <xsl:choose>
  1011. <xsl:when test="$countType &gt; 1">
  1012. <xsl:value-of select="concat($posId,'/hyperlink[',$index,']')"/>
  1013. </xsl:when>
  1014. <xsl:otherwise>
  1015. <xsl:value-of select="concat($posId,'/hyperlink')"/>
  1016. </xsl:otherwise>
  1017. </xsl:choose>
  1018. </posId>
  1019. <conditional>
  1020. <xsl:choose>
  1021. <xsl:when test="./conditionalRender">true</xsl:when>
  1022. <xsl:otherwise>
  1023. <xsl:value-of select="$conditional"/>
  1024. </xsl:otherwise>
  1025. </xsl:choose>
  1026. </conditional>
  1027. <MHyperlink>
  1028. <xsl:if test="@name">
  1029. <ldx:id>
  1030. <xsl:value-of select="@name"/>
  1031. </ldx:id>
  1032. </xsl:if>
  1033. </MHyperlink>
  1034. </item>
  1035. </xsl:template>
  1036. <xsl:template match="button">
  1037. <!--Not yet handled-->
  1038. </xsl:template>
  1039. <xsl:template match="promptButton">
  1040. <!--Not yet handled-->
  1041. </xsl:template>
  1042. <xsl:template match="HTMLItem">
  1043. <xsl:param name="posId"/>
  1044. <xsl:param name="conditional"/>
  1045. <xsl:variable name="countType">
  1046. <xsl:value-of select="count(../HTMLItem)"/>
  1047. </xsl:variable>
  1048. <xsl:variable name="index">
  1049. <xsl:value-of select="1 + count(preceding-sibling::HTMLItem)"/>
  1050. </xsl:variable>
  1051. <item>
  1052. <posId>
  1053. <xsl:choose>
  1054. <xsl:when test="$countType &gt; 1">
  1055. <xsl:value-of select="concat($posId,'/HTMLItem[',$index,']')"/>
  1056. </xsl:when>
  1057. <xsl:otherwise>
  1058. <xsl:value-of select="concat($posId,'/HTMLItem')"/>
  1059. </xsl:otherwise>
  1060. </xsl:choose>
  1061. </posId>
  1062. <conditional>
  1063. <xsl:choose>
  1064. <xsl:when test="./conditionalRender">true</xsl:when>
  1065. <xsl:otherwise>
  1066. <xsl:value-of select="$conditional"/>
  1067. </xsl:otherwise>
  1068. </xsl:choose>
  1069. </conditional>
  1070. <MHTML>
  1071. <xsl:if test="@name">
  1072. <ldx:id>
  1073. <xsl:value-of select="@name"/>
  1074. </ldx:id>
  1075. </xsl:if>
  1076. </MHTML>
  1077. </item>
  1078. </xsl:template>
  1079. <xsl:template match="customContent">
  1080. <xsl:param name="posId"/>
  1081. <xsl:param name="conditional"/>
  1082. <xsl:variable name="countType">
  1083. <xsl:value-of select="count(../customContent)"/>
  1084. </xsl:variable>
  1085. <xsl:variable name="index">
  1086. <xsl:value-of select="1 + count(preceding-sibling::customContent)"/>
  1087. </xsl:variable>
  1088. <xsl:call-template name="richTextItem">
  1089. <xsl:with-param name="posId" select="concat($posId,'/customContent')"/>
  1090. <xsl:with-param name="conditional" select="$conditional"/>
  1091. <xsl:with-param name="index" select="$index"/>
  1092. <xsl:with-param name="countType" select="$countType"/>
  1093. </xsl:call-template>
  1094. </xsl:template>
  1095. <xsl:template match="richTextItem">
  1096. <xsl:param name="posId"/>
  1097. <xsl:param name="conditional"/>
  1098. <xsl:variable name="countType">
  1099. <xsl:value-of select="count(../richTextItem)"/>
  1100. </xsl:variable>
  1101. <xsl:variable name="index">
  1102. <xsl:value-of select="1 + count(preceding-sibling::richTextItem)"/>
  1103. </xsl:variable>
  1104. <xsl:call-template name="richTextItem">
  1105. <xsl:with-param name="posId" select="concat($posId,'/richTextItem')"/>
  1106. <xsl:with-param name="conditional" select="$conditional"/>
  1107. <xsl:with-param name="index" select="$index"/>
  1108. <xsl:with-param name="countType" select="$countType"/>
  1109. </xsl:call-template>
  1110. </xsl:template>
  1111. <xsl:template name="richTextItem">
  1112. <xsl:param name="posId"/>
  1113. <xsl:param name="conditional"/>
  1114. <xsl:param name="index"/>
  1115. <xsl:param name="countType"/>
  1116. <item>
  1117. <posId>
  1118. <xsl:choose>
  1119. <xsl:when test="$countType &gt; 1">
  1120. <xsl:value-of select="concat($posId,'[',$index,']')"/>
  1121. </xsl:when>
  1122. <xsl:otherwise>
  1123. <xsl:value-of select="$posId"/>
  1124. </xsl:otherwise>
  1125. </xsl:choose>
  1126. </posId>
  1127. <conditional>
  1128. <xsl:choose>
  1129. <xsl:when test="./conditionalRender">true</xsl:when>
  1130. <xsl:otherwise>
  1131. <xsl:value-of select="$conditional"/>
  1132. </xsl:otherwise>
  1133. </xsl:choose>
  1134. </conditional>
  1135. <MRichText>
  1136. <xsl:if test="@name">
  1137. <ldx:id>
  1138. <xsl:value-of select="@name"/>
  1139. </ldx:id>
  1140. </xsl:if>
  1141. </MRichText>
  1142. </item>
  1143. </xsl:template>
  1144. <xsl:template match="bookmark">
  1145. <xsl:param name="posId"/>
  1146. <xsl:param name="conditional"/>
  1147. <xsl:variable name="countType">
  1148. <xsl:value-of select="count(../bookmark)"/>
  1149. </xsl:variable>
  1150. <xsl:variable name="index">
  1151. <xsl:value-of select="1 + count(preceding-sibling::bookmark)"/>
  1152. </xsl:variable>
  1153. <item>
  1154. <posId>
  1155. <xsl:choose>
  1156. <xsl:when test="$countType &gt; 1">
  1157. <xsl:value-of select="concat($posId,'/bookmark[',$index,']')"/>
  1158. </xsl:when>
  1159. <xsl:otherwise>
  1160. <xsl:value-of select="concat($posId,'/bookmark')"/>
  1161. </xsl:otherwise>
  1162. </xsl:choose>
  1163. </posId>
  1164. <conditional>
  1165. <xsl:choose>
  1166. <xsl:when test="./conditionalRender">true</xsl:when>
  1167. <xsl:otherwise>
  1168. <xsl:value-of select="$conditional"/>
  1169. </xsl:otherwise>
  1170. </xsl:choose>
  1171. </conditional>
  1172. <MBookmark>
  1173. <xsl:choose>
  1174. <xsl:when test="@name">
  1175. <ldx:id>
  1176. <xsl:value-of select="@name"/>
  1177. </ldx:id>
  1178. </xsl:when>
  1179. <xsl:otherwise>
  1180. <xsl:if test="dataSource/staticValue">
  1181. <ldx:id>
  1182. <xsl:value-of select="dataSource/staticValue"/>
  1183. </ldx:id>
  1184. </xsl:if>
  1185. </xsl:otherwise>
  1186. </xsl:choose>
  1187. </MBookmark>
  1188. </item>
  1189. </xsl:template>
  1190. <xsl:template match="TOCEntry">
  1191. <xsl:param name="posId"/>
  1192. <xsl:param name="conditional"/>
  1193. <xsl:variable name="countType">
  1194. <xsl:value-of select="count(../TOCEntry)"/>
  1195. </xsl:variable>
  1196. <xsl:variable name="index">
  1197. <xsl:value-of select="1 + count(preceding-sibling::TOCEntry)"/>
  1198. </xsl:variable>
  1199. <item>
  1200. <posId>
  1201. <xsl:choose>
  1202. <xsl:when test="$countType &gt; 1">
  1203. <xsl:value-of select="concat($posId,'/TOCEntry[',$index,']')"/>
  1204. </xsl:when>
  1205. <xsl:otherwise>
  1206. <xsl:value-of select="concat($posId,'/TOCEntry')"/>
  1207. </xsl:otherwise>
  1208. </xsl:choose>
  1209. </posId>
  1210. <!-- TOCEntry items are also mapped to bookmark object -->
  1211. <!-- Note: neither TOCEntry nor bookmark have name attrbitues, so id will be empty -->
  1212. <conditional>
  1213. <xsl:choose>
  1214. <xsl:when test="./conditionalRender">true</xsl:when>
  1215. <xsl:otherwise>
  1216. <xsl:value-of select="$conditional"/>
  1217. </xsl:otherwise>
  1218. </xsl:choose>
  1219. </conditional>
  1220. <MBookmark>
  1221. <xsl:if test="@name">
  1222. <ldx:id>
  1223. <xsl:value-of select="@name"/>
  1224. </ldx:id>
  1225. </xsl:if>
  1226. </MBookmark>
  1227. </item>
  1228. </xsl:template>
  1229. <xsl:template match="fieldSet">
  1230. <xsl:param name="posId"/>
  1231. <xsl:param name="conditional"/>
  1232. <xsl:variable name="countType">
  1233. <xsl:value-of select="count(../fieldset)"/>
  1234. </xsl:variable>
  1235. <xsl:variable name="index">
  1236. <xsl:value-of select="1 + count(preceding-sibling::fieldset)"/>
  1237. </xsl:variable>
  1238. <xsl:apply-templates select="fieldSetCaption/contents/*">
  1239. <xsl:with-param name="posId">
  1240. <xsl:choose>
  1241. <xsl:when test="$countType &gt; 1">
  1242. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption[',$index,']/contents')"/>
  1243. </xsl:when>
  1244. <xsl:otherwise>
  1245. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption/contents')"/>
  1246. </xsl:otherwise>
  1247. </xsl:choose>
  1248. </xsl:with-param>
  1249. <xsl:with-param name="conditional"><xsl:value-of select="$conditional"/></xsl:with-param>
  1250. </xsl:apply-templates>
  1251. <xsl:apply-templates select="contents/*">
  1252. <xsl:with-param name="posId">
  1253. <xsl:choose>
  1254. <xsl:when test="$countType &gt; 1">
  1255. <xsl:value-of select="concat($posId,'/fieldSet[',$index,']/contents')"/>
  1256. </xsl:when>
  1257. <xsl:otherwise>
  1258. <xsl:value-of select="concat($posId,'/fieldSet/contents')"/>
  1259. </xsl:otherwise>
  1260. </xsl:choose>
  1261. </xsl:with-param>
  1262. <xsl:with-param name="conditional"><xsl:value-of select="$conditional"/></xsl:with-param>
  1263. </xsl:apply-templates>
  1264. </xsl:template>
  1265. <xsl:template match="conditionalBlocks">
  1266. <xsl:param name="posId"/>
  1267. <xsl:variable name="countType">
  1268. <xsl:value-of select="count(../conditionalBlocks)"/>
  1269. </xsl:variable>
  1270. <xsl:variable name="index">
  1271. <xsl:value-of select="1 + count(preceding-sibling::conditionalBlocks)"/>
  1272. </xsl:variable>
  1273. <xsl:apply-templates select="./conditionalBlockDefault/contents/*">
  1274. <xsl:with-param name="posId">
  1275. <xsl:value-of select="concat($posId,'/conditionalBlockDefault/contents')"/>
  1276. </xsl:with-param>
  1277. <xsl:with-param name="conditional">true</xsl:with-param>
  1278. </xsl:apply-templates>
  1279. <xsl:for-each select="./conditionalBlockCases/conditionalBlock">
  1280. <xsl:apply-templates select="./contents/*">
  1281. <xsl:with-param name="posId">
  1282. <xsl:choose>
  1283. <xsl:when test="count(../conditionalBlock) &gt; 1">
  1284. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock[',1 + count(preceding-sibling::conditionalBlock),']/contents')"/>
  1285. </xsl:when>
  1286. <xsl:otherwise>
  1287. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock/contents')"/>
  1288. </xsl:otherwise>
  1289. </xsl:choose>
  1290. </xsl:with-param>
  1291. <xsl:with-param name="conditional">true</xsl:with-param>
  1292. </xsl:apply-templates>
  1293. </xsl:for-each>
  1294. </xsl:template>
  1295. <xsl:template match="layoutComponentRef">
  1296. <xsl:param name="conditional"/>
  1297. <xsl:param name="posId"/>
  1298. <xsl:variable name="countType">
  1299. <xsl:value-of select="count(../layoutComponentRef)"/>
  1300. </xsl:variable>
  1301. <xsl:variable name="index">
  1302. <xsl:value-of select="1 + count(preceding-sibling::layoutComponentRef)"/>
  1303. </xsl:variable>
  1304. <!-- LCR will be handled in next version -->
  1305. </xsl:template>
  1306. <xsl:template match="CMMMap">
  1307. <xsl:param name="posId"/>
  1308. <xsl:param name="conditional"/>
  1309. <xsl:variable name="countType">
  1310. <xsl:value-of select="count(../CMMMap)"/>
  1311. </xsl:variable>
  1312. <xsl:variable name="index">
  1313. <xsl:value-of select="1 + count(preceding-sibling::CMMMap)"/>
  1314. </xsl:variable>
  1315. <item>
  1316. <posId>
  1317. <xsl:choose>
  1318. <xsl:when test="$countType &gt; 1">
  1319. <xsl:value-of select="concat($posId,'/CMMMap[',$index,']')"/>
  1320. </xsl:when>
  1321. <xsl:otherwise>
  1322. <xsl:value-of select="concat($posId,'/CMMMap')"/>
  1323. </xsl:otherwise>
  1324. </xsl:choose>
  1325. </posId>
  1326. <conditional>
  1327. <xsl:choose>
  1328. <xsl:when test="./conditionalRender">true</xsl:when>
  1329. <xsl:otherwise>
  1330. <xsl:value-of select="$conditional"/>
  1331. </xsl:otherwise>
  1332. </xsl:choose>
  1333. </conditional>
  1334. <MImage>
  1335. <xsl:if test="@cmmID">
  1336. <ldx:id>
  1337. <xsl:value-of select="@cmmID"/>
  1338. </ldx:id>
  1339. </xsl:if>
  1340. </MImage>
  1341. </item>
  1342. </xsl:template>
  1343. <xsl:template match="asOfTime">
  1344. <!--Not yet handled-->
  1345. </xsl:template>
  1346. <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 | viz">
  1347. <xsl:param name="posId"/>
  1348. <xsl:param name="conditional"/>
  1349. <item>
  1350. <posId>
  1351. <xsl:choose>
  1352. <xsl:when test="name() = 'pieChart'">
  1353. <xsl:choose>
  1354. <xsl:when test="count(../pieChart) &gt; 1">
  1355. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::pieChart),']')"/>
  1356. </xsl:when>
  1357. <xsl:otherwise>
  1358. <xsl:value-of select="concat($posId,'/pieChart')"/>
  1359. </xsl:otherwise>
  1360. </xsl:choose>
  1361. </xsl:when>
  1362. <xsl:when test="name() = 'paretoChart'">
  1363. <xsl:choose>
  1364. <xsl:when test="count(../paretoChart) &gt; 1">
  1365. <xsl:value-of select="concat($posId,'/paretoChart[',1 + count(preceding-sibling::paretoChart),']')"/>
  1366. </xsl:when>
  1367. <xsl:otherwise>
  1368. <xsl:value-of select="concat($posId,'/paretoChart')"/>
  1369. </xsl:otherwise>
  1370. </xsl:choose>
  1371. </xsl:when>
  1372. <xsl:when test="name() = 'scatterChart'">
  1373. <xsl:choose>
  1374. <xsl:when test="count(../scatterChart) &gt; 1">
  1375. <xsl:value-of select="concat($posId,'/scatterChart[',1 + count(preceding-sibling::scatterChart),']')"/>
  1376. </xsl:when>
  1377. <xsl:otherwise>
  1378. <xsl:value-of select="concat($posId,'/scatterChart')"/>
  1379. </xsl:otherwise>
  1380. </xsl:choose>
  1381. </xsl:when>
  1382. <xsl:when test="name() = 'polarChart'">
  1383. <xsl:choose>
  1384. <xsl:when test="count(../polarChart) &gt; 1">
  1385. <xsl:value-of select="concat($posId,'/polarChart[',1 + count(preceding-sibling::polarChart),']')"/>
  1386. </xsl:when>
  1387. <xsl:otherwise>
  1388. <xsl:value-of select="concat($posId,'/polarChart')"/>
  1389. </xsl:otherwise>
  1390. </xsl:choose>
  1391. </xsl:when>
  1392. <xsl:when test="name() = 'radarChart'">
  1393. <xsl:choose>
  1394. <xsl:when test="count(../radarChart) &gt; 1">
  1395. <xsl:value-of select="concat($posId,'/radarChart[',1 + count(preceding-sibling::radarChart),']')"/>
  1396. </xsl:when>
  1397. <xsl:otherwise>
  1398. <xsl:value-of select="concat($posId,'/radarChart')"/>
  1399. </xsl:otherwise>
  1400. </xsl:choose>
  1401. </xsl:when>
  1402. <xsl:when test="name() = 'progressiveChart'">
  1403. <xsl:choose>
  1404. <xsl:when test="count(../progressiveChart) &gt; 1">
  1405. <xsl:value-of select="concat($posId,'/progressiveChart[',1 + count(preceding-sibling::progressiveChart),']')"/>
  1406. </xsl:when>
  1407. <xsl:otherwise>
  1408. <xsl:value-of select="concat($posId,'/progressiveChart')"/>
  1409. </xsl:otherwise>
  1410. </xsl:choose>
  1411. </xsl:when>
  1412. <xsl:when test="name() = 'combinationChart'">
  1413. <xsl:choose>
  1414. <xsl:when test="count(../combinationChart) &gt; 1">
  1415. <xsl:value-of select="concat($posId,'/combinationChart[',1 + count(preceding-sibling::combinationChart),']')"/>
  1416. </xsl:when>
  1417. <xsl:otherwise>
  1418. <xsl:value-of select="concat($posId,'/combinationChart')"/>
  1419. </xsl:otherwise>
  1420. </xsl:choose>
  1421. </xsl:when>
  1422. <xsl:when test="name() = 'bubbleChart'">
  1423. <xsl:choose>
  1424. <xsl:when test="count(../bubbleChart) &gt; 1">
  1425. <xsl:value-of select="concat($posId,'/bubbleChart[',1 + count(preceding-sibling::bubbleChart),']')"/>
  1426. </xsl:when>
  1427. <xsl:otherwise>
  1428. <xsl:value-of select="concat($posId,'/bubbleChart')"/>
  1429. </xsl:otherwise>
  1430. </xsl:choose>
  1431. </xsl:when>
  1432. <xsl:when test="name() = 'threeDCombinationChart'">
  1433. <xsl:choose>
  1434. <xsl:when test="count(../threeDCombinationChart) &gt; 1">
  1435. <xsl:value-of select="concat($posId,'/threeDCombinationChart[',1 + count(preceding-sibling::threeDCombinationChart),']')"/>
  1436. </xsl:when>
  1437. <xsl:otherwise>
  1438. <xsl:value-of select="concat($posId,'/threeDCombinationChart')"/>
  1439. </xsl:otherwise>
  1440. </xsl:choose>
  1441. </xsl:when>
  1442. <xsl:when test="name() = 'threeDScatterChart'">
  1443. <xsl:choose>
  1444. <xsl:when test="count(../threeDScatterChart) &gt; 1">
  1445. <xsl:value-of select="concat($posId,'/threeDScatterChart[',1 + count(preceding-sibling::threeDScatterChart),']')"/>
  1446. </xsl:when>
  1447. <xsl:otherwise>
  1448. <xsl:value-of select="concat($posId,'/threeDScatterChart')"/>
  1449. </xsl:otherwise>
  1450. </xsl:choose>
  1451. </xsl:when>
  1452. <xsl:when test="name() = 'gaugeChart'">
  1453. <xsl:choose>
  1454. <xsl:when test="count(../gaugeChart) &gt; 1">
  1455. <xsl:value-of select="concat($posId,'/gaugeChart[',1 + count(preceding-sibling::gaugeChart),']')"/>
  1456. </xsl:when>
  1457. <xsl:otherwise>
  1458. <xsl:value-of select="concat($posId,'/gaugeChart')"/>
  1459. </xsl:otherwise>
  1460. </xsl:choose>
  1461. </xsl:when>
  1462. <xsl:when test="name() = 'mapChart'">
  1463. <xsl:choose>
  1464. <xsl:when test="count(../mapChart) &gt; 1">
  1465. <xsl:value-of select="concat($posId,'/mapChart[',1 + count(preceding-sibling::mapChart),']')"/>
  1466. </xsl:when>
  1467. <xsl:otherwise>
  1468. <xsl:value-of select="concat($posId,'/mapChart')"/>
  1469. </xsl:otherwise>
  1470. </xsl:choose>
  1471. </xsl:when>
  1472. <xsl:when test="name() = 'metricsChart'">
  1473. <xsl:choose>
  1474. <xsl:when test="count(../metricsChart) &gt; 1">
  1475. <xsl:value-of select="concat($posId,'/metricsChart[',1 + count(preceding-sibling::metricsChart),']')"/>
  1476. </xsl:when>
  1477. <xsl:otherwise>
  1478. <xsl:value-of select="concat($posId,'/metricsChart')"/>
  1479. </xsl:otherwise>
  1480. </xsl:choose>
  1481. </xsl:when>
  1482. <xsl:when test="name() = 'marimekkoChart'">
  1483. <xsl:choose>
  1484. <xsl:when test="count(../marimekkoChart) &gt; 1">
  1485. <xsl:value-of select="concat($posId,'/marimekkoChart[',1 + count(preceding-sibling::marimekkoChart),']')"/>
  1486. </xsl:when>
  1487. <xsl:otherwise>
  1488. <xsl:value-of select="concat($posId,'/marimekkoChart')"/>
  1489. </xsl:otherwise>
  1490. </xsl:choose>
  1491. </xsl:when>
  1492. <xsl:when test="name() = 'winLossChart'">
  1493. <xsl:choose>
  1494. <xsl:when test="count(../winLossChart) &gt; 1">
  1495. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::winLossChart),']')"/>
  1496. </xsl:when>
  1497. <xsl:otherwise>
  1498. <xsl:value-of select="concat($posId,'/winLossChart')"/>
  1499. </xsl:otherwise>
  1500. </xsl:choose>
  1501. </xsl:when>
  1502. <xsl:when test="name() = 'v2_combinationChart'">
  1503. <xsl:choose>
  1504. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1505. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::v2_combinationChart),']')"/>
  1506. </xsl:when>
  1507. <xsl:otherwise>
  1508. <xsl:value-of select="concat($posId,'/v2_combinationChart')"/>
  1509. </xsl:otherwise>
  1510. </xsl:choose>
  1511. </xsl:when>
  1512. <xsl:when test="name() = 'v2_scatterChart'">
  1513. <xsl:choose>
  1514. <xsl:when test="count(../v2_scatterChart) &gt; 1">
  1515. <xsl:value-of select="concat($posId,'/v2_scatterChart[',1 + count(preceding-sibling::v2_scatterChart),']')"/>
  1516. </xsl:when>
  1517. <xsl:otherwise>
  1518. <xsl:value-of select="concat($posId,'/v2_schatterChart')"/>
  1519. </xsl:otherwise>
  1520. </xsl:choose>
  1521. </xsl:when>
  1522. <xsl:when test="name() = 'v2_pieChart'">
  1523. <xsl:choose>
  1524. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1525. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::v2_pieChart),']')"/>
  1526. </xsl:when>
  1527. <xsl:otherwise>
  1528. <xsl:value-of select="concat($posId,'/v2_pieChart')"/>
  1529. </xsl:otherwise>
  1530. </xsl:choose>
  1531. </xsl:when>
  1532. <xsl:when test="name() = 'v2_guageChart'">
  1533. <xsl:choose>
  1534. <xsl:when test="count(../v2_guageChart) &gt; 1">
  1535. <xsl:value-of select="concat($posId,'/v2_guageChart[',1 + count(preceding-sibling::v2_guageChart),']')"/>
  1536. </xsl:when>
  1537. <xsl:otherwise>
  1538. <xsl:value-of select="concat($posId,'/v2_guageChart')"/>
  1539. </xsl:otherwise>
  1540. </xsl:choose>
  1541. </xsl:when>
  1542. <xsl:when test="name() = 'v2_matrixChart'">
  1543. <xsl:choose>
  1544. <xsl:when test="count(../v2_matrixChart) &gt; 1">
  1545. <xsl:value-of select="concat($posId,'/v2_matrixChart[',1 + count(preceding-sibling::v2_matrixChart),']')"/>
  1546. </xsl:when>
  1547. <xsl:otherwise>
  1548. <xsl:value-of select="concat($posId,'/v2_matrixChart')"/>
  1549. </xsl:otherwise>
  1550. </xsl:choose>
  1551. </xsl:when>
  1552. <xsl:when test="name() = 'v2_progressiveChart'">
  1553. <xsl:choose>
  1554. <xsl:when test="count(../v2_progressiveChart) &gt; 1">
  1555. <xsl:value-of select="concat($posId,'/v2_progressiveChart[',1 + count(preceding-sibling::v2_progressiveChart),']')"/>
  1556. </xsl:when>
  1557. <xsl:otherwise>
  1558. <xsl:value-of select="concat($posId,'/v2_progressiveChart')"/>
  1559. </xsl:otherwise>
  1560. </xsl:choose>
  1561. </xsl:when>
  1562. <xsl:when test="name() = 'v2_paretoChart'">
  1563. <xsl:choose>
  1564. <xsl:when test="count(../v2_paretoChart) &gt; 1">
  1565. <xsl:value-of select="concat($posId,'/v2_paretoChart[',1 + count(preceding-sibling::v2_paretoChart),']')"/>
  1566. </xsl:when>
  1567. <xsl:otherwise>
  1568. <xsl:value-of select="concat($posId,'/v2_paretoChart')"/>
  1569. </xsl:otherwise>
  1570. </xsl:choose>
  1571. </xsl:when>
  1572. <xsl:when test="name() = 'v2_bubbleChart'">
  1573. <xsl:choose>
  1574. <xsl:when test="count(../v2_bubbleChart) &gt; 1">
  1575. <xsl:value-of select="concat($posId,'/v2_bubbleChart[',1 + count(preceding-sibling::v2_bubbleChart),']')"/>
  1576. </xsl:when>
  1577. <xsl:otherwise>
  1578. <xsl:value-of select="concat($posId,'/v2_bubbleChart')"/>
  1579. </xsl:otherwise>
  1580. </xsl:choose>
  1581. </xsl:when>
  1582. <xsl:when test="name() = 'v2_repeaterChart'">
  1583. <xsl:choose>
  1584. <xsl:when test="count(../v2_repeaterChart) &gt; 1">
  1585. <xsl:value-of select="concat($posId,'/v2_repeaterChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1586. </xsl:when>
  1587. <xsl:otherwise>
  1588. <xsl:value-of select="concat($posId,'/v2_repeaterChart')"/>
  1589. </xsl:otherwise>
  1590. </xsl:choose>
  1591. </xsl:when>
  1592. <xsl:when test="name() = 'v2_bulletChart'">
  1593. <xsl:choose>
  1594. <xsl:when test="count(../v2_bulletChart) &gt; 1">
  1595. <xsl:value-of select="concat($posId,'/v2_bulletChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1596. </xsl:when>
  1597. <xsl:otherwise>
  1598. <xsl:value-of select="concat($posId,'/v2_bulletChart')"/>
  1599. </xsl:otherwise>
  1600. </xsl:choose>
  1601. </xsl:when>
  1602. <xsl:when test="name() = 'viz'">
  1603. <xsl:choose>
  1604. <xsl:when test="count(../viz) &gt; 1">
  1605. <xsl:value-of select="concat($posId,'/viz[',1 + count(preceding-sibling::viz),']')"/>
  1606. </xsl:when>
  1607. <xsl:otherwise>
  1608. <xsl:value-of select="concat($posId,'/viz')"/>
  1609. </xsl:otherwise>
  1610. </xsl:choose>
  1611. </xsl:when>
  1612. <xsl:otherwise>
  1613. <xsl:value-of select="concat($posId,'/unknownChartType')"/>
  1614. </xsl:otherwise>
  1615. </xsl:choose>
  1616. </posId>
  1617. <conditional>
  1618. <xsl:choose>
  1619. <xsl:when test="./conditionalRender">true</xsl:when>
  1620. <xsl:otherwise>
  1621. <xsl:value-of select="$conditional"/>
  1622. </xsl:otherwise>
  1623. </xsl:choose>
  1624. </conditional>
  1625. <xsl:variable name="chart-name">
  1626. <xsl:choose>
  1627. <xsl:when test="name() = 'viz'">MImage</xsl:when>
  1628. <xsl:otherwise>MChart</xsl:otherwise>
  1629. </xsl:choose>
  1630. </xsl:variable>
  1631. <xsl:element name="{$chart-name}">
  1632. <xsl:if test="@name">
  1633. <ldx:id>
  1634. <xsl:choose>
  1635. <xsl:when test="function-available('ccs:getInfoPartName')">
  1636. <xsl:value-of select="ccs:getInfoPartName(@name,'Chart')"/>
  1637. </xsl:when>
  1638. <xsl:otherwise>
  1639. <xsl:value-of select="@name"/>
  1640. </xsl:otherwise>
  1641. </xsl:choose>
  1642. </ldx:id>
  1643. </xsl:if>
  1644. </xsl:element>
  1645. </item>
  1646. </xsl:template>
  1647. <xsl:template match="singleton">
  1648. <xsl:param name="posId"/>
  1649. <xsl:param name="conditional"/>
  1650. <xsl:variable name="countType">
  1651. <xsl:value-of select="count(../singleton)"/>
  1652. </xsl:variable>
  1653. <xsl:variable name="index">
  1654. <xsl:value-of select="1 + count(preceding-sibling::singleton)"/>
  1655. </xsl:variable>
  1656. <xsl:apply-templates select="contents/*">
  1657. <xsl:with-param name="posId">
  1658. <xsl:choose>
  1659. <xsl:when test="$countType &gt; 1">
  1660. <xsl:value-of select="concat($posId,'/singleton[',$index,']/contents')"/>
  1661. </xsl:when>
  1662. <xsl:otherwise>
  1663. <xsl:value-of select="concat($posId,'/singleton/contents')"/>
  1664. </xsl:otherwise>
  1665. </xsl:choose>
  1666. </xsl:with-param>
  1667. <xsl:with-param name="conditional"><xsl:value-of select="$conditional"/></xsl:with-param>
  1668. </xsl:apply-templates>
  1669. </xsl:template>
  1670. <xsl:template match="*">
  1671. <!--Unknown element. Ignore-->
  1672. </xsl:template>
  1673. </xsl:stylesheet>