layout.xsl 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  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:ccs="com.cognos.ccs.xslt.XSLTFunctions" xmlns="http://developer.cognos.com/schemas/rds/types/2" 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. <layout>
  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. <xsl:apply-templates select="/report/classStyles/*"/>
  16. </layout>
  17. </xsl:template>
  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:variable name="countType">
  240. <xsl:value-of select="count(../table)"/>
  241. </xsl:variable>
  242. <xsl:variable name="index">
  243. <xsl:value-of select="1 + count(preceding-sibling::table)"/>
  244. </xsl:variable>
  245. <item>
  246. <LTable>
  247. <xsl:apply-templates select="tableRows/tableRow">
  248. <xsl:with-param name="posId">
  249. <xsl:choose>
  250. <xsl:when test="$countType &gt; 1">
  251. <xsl:value-of select="concat($posId,'/table[',$index,']')"/>
  252. </xsl:when>
  253. <xsl:otherwise>
  254. <xsl:value-of select="concat($posId,'/table')"/>
  255. </xsl:otherwise>
  256. </xsl:choose>
  257. </xsl:with-param>
  258. </xsl:apply-templates>
  259. <xsl:if test="style/CSS">
  260. <CSSStyle>
  261. <xsl:value-of select="style/CSS/@value"/>
  262. </CSSStyle>
  263. </xsl:if>
  264. <xsl:apply-templates select="style/defaultStyles/*"/>
  265. </LTable>
  266. </item>
  267. </xsl:template>
  268. <xsl:template match="tableRow">
  269. <xsl:param name="posId"/>
  270. <xsl:variable name="countType">
  271. <xsl:value-of select="count(../tableRow)"/>
  272. </xsl:variable>
  273. <xsl:variable name="index">
  274. <xsl:value-of select="1 + count(preceding-sibling::tableRow)"/>
  275. </xsl:variable>
  276. <row>
  277. <xsl:apply-templates select="tableCells/tableCell">
  278. <xsl:with-param name="posId">
  279. <xsl:choose>
  280. <xsl:when test="$countType &gt; 1">
  281. <xsl:value-of select="concat($posId,'/tableRows/tableRow[',$index,']')"/>
  282. </xsl:when>
  283. <xsl:otherwise>
  284. <xsl:value-of select="concat($posId,'/tableRows/tableRow')"/>
  285. </xsl:otherwise>
  286. </xsl:choose>
  287. </xsl:with-param>
  288. </xsl:apply-templates>
  289. <xsl:if test="style/CSS">
  290. <CSSStyle>
  291. <xsl:value-of select="style/CSS/@value"/>
  292. </CSSStyle>
  293. </xsl:if>
  294. <xsl:apply-templates select="style/defaultStyles/*"/>
  295. </row>
  296. </xsl:template>
  297. <xsl:template match="tableCell">
  298. <xsl:param name="posId"/>
  299. <xsl:variable name="countType">
  300. <xsl:value-of select="count(../tableCell)"/>
  301. </xsl:variable>
  302. <xsl:variable name="index">
  303. <xsl:value-of select="1 + count(preceding-sibling::tableCell)"/>
  304. </xsl:variable>
  305. <cell>
  306. <xsl:if test="@colSpan">
  307. <colSpan>
  308. <xsl:value-of select="@colSpan"/>
  309. </colSpan>
  310. </xsl:if>
  311. <xsl:apply-templates select="contents/*">
  312. <xsl:with-param name="posId">
  313. <xsl:choose>
  314. <xsl:when test="$countType &gt; 1">
  315. <xsl:value-of select="concat($posId,'/tableCells/tableCell[',$index,']/contents')"/>
  316. </xsl:when>
  317. <xsl:otherwise>
  318. <xsl:value-of select="concat($posId,'/tableCells/tableCell/contents')"/>
  319. </xsl:otherwise>
  320. </xsl:choose>
  321. </xsl:with-param>
  322. </xsl:apply-templates>
  323. <xsl:if test="style/CSS">
  324. <CSSStyle>
  325. <xsl:value-of select="style/CSS/@value"/>
  326. </CSSStyle>
  327. </xsl:if>
  328. <xsl:apply-templates select="style/defaultStyles/*"/>
  329. </cell>
  330. </xsl:template>
  331. <xsl:template match="block">
  332. <xsl:param name="posId"/>
  333. <xsl:variable name="countType">
  334. <xsl:value-of select="count(../block)"/>
  335. </xsl:variable>
  336. <xsl:variable name="index">
  337. <xsl:value-of select="1 + count(preceding-sibling::block)"/>
  338. </xsl:variable>
  339. <item>
  340. <LContainer>
  341. <xsl:apply-templates select="contents/*">
  342. <xsl:with-param name="posId">
  343. <xsl:choose>
  344. <xsl:when test="$countType &gt; 1">
  345. <xsl:value-of select="concat($posId,'/block[',$index,']/contents')"/>
  346. </xsl:when>
  347. <xsl:otherwise>
  348. <xsl:value-of select="concat($posId,'/block/contents')"/>
  349. </xsl:otherwise>
  350. </xsl:choose>
  351. </xsl:with-param>
  352. </xsl:apply-templates>
  353. <xsl:if test="style/CSS">
  354. <CSSStyle>
  355. <xsl:value-of select="style/CSS/@value"/>
  356. </CSSStyle>
  357. </xsl:if>
  358. <xsl:apply-templates select="style/defaultStyles/*"/>
  359. </LContainer>
  360. </item>
  361. </xsl:template>
  362. <xsl:template match="list">
  363. <xsl:param name="posId"/>
  364. <xsl:param name="conditional"/>
  365. <xsl:variable name="countType">
  366. <xsl:value-of select="count(../list)"/>
  367. </xsl:variable>
  368. <xsl:variable name="refQuery">
  369. <xsl:value-of select="@refQuery"/>
  370. </xsl:variable>
  371. <xsl:variable name="index">
  372. <xsl:value-of select="1 + count(preceding-sibling::list)"/>
  373. </xsl:variable>
  374. <item>
  375. <LReference>
  376. <xsl:if test="@name">
  377. <ldx:id>
  378. <xsl:value-of select="@name"/>
  379. </ldx:id>
  380. </xsl:if>
  381. <posId>
  382. <xsl:choose>
  383. <xsl:when test="$countType &gt; 1">
  384. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  385. </xsl:when>
  386. <xsl:otherwise>
  387. <xsl:value-of select="concat($posId,'/list')"/>
  388. </xsl:otherwise>
  389. </xsl:choose>
  390. </posId>
  391. <xsl:if test="listGroups">
  392. <extension>
  393. <LList>
  394. <xsl:variable name="listId">
  395. <xsl:choose>
  396. <xsl:when test="$countType &gt; 1">
  397. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  398. </xsl:when>
  399. <xsl:otherwise>
  400. <xsl:value-of select="concat($posId,'/list')"/>
  401. </xsl:otherwise>
  402. </xsl:choose>
  403. </xsl:variable>
  404. <xsl:apply-templates select="listGroups/*">
  405. <xsl:with-param name="posId">
  406. <xsl:value-of select="concat($listId, '/listGroups')"/>
  407. </xsl:with-param>
  408. <xsl:with-param name="conditional">
  409. <xsl:value-of select="$conditional"/>
  410. </xsl:with-param>
  411. </xsl:apply-templates>
  412. <xsl:apply-templates select="listOverallGroup/*">
  413. <xsl:with-param name="posId">
  414. <xsl:value-of select="$listId"/>
  415. </xsl:with-param>
  416. <xsl:with-param name="conditional">
  417. <xsl:value-of select="$conditional"/>
  418. </xsl:with-param>
  419. </xsl:apply-templates>
  420. </LList>
  421. </extension>
  422. </xsl:if>
  423. </LReference>
  424. </item>
  425. </xsl:template>
  426. <xsl:template match="listGroup">
  427. <xsl:param name="posId"/>
  428. <xsl:param name="conditional"/>
  429. <xsl:param name="refQuery"/>
  430. <xsl:variable name="countType">
  431. <xsl:value-of select="count(../list)"/>
  432. </xsl:variable>
  433. <xsl:variable name="index">
  434. <xsl:value-of select="1 + count(preceding-sibling::list)"/>
  435. </xsl:variable>
  436. <xsl:variable name="listGroupId">
  437. <xsl:choose>
  438. <xsl:when test="$countType &gt; 1">
  439. <xsl:value-of select="concat($posId,'/listGroup/list[',$index,']')"/>
  440. </xsl:when>
  441. <xsl:otherwise>
  442. <xsl:value-of select="concat($posId,'/listGroup')"/>
  443. </xsl:otherwise>
  444. </xsl:choose>
  445. </xsl:variable>
  446. <listGroup>
  447. <key>
  448. <xsl:variable name="refDataItem" select="@refDataItem"/>
  449. <xsl:variable name="label" select="/report/queries/query[@name=$refQuery]/selection/*[@name=$refDataItem and @label]/@label"/>
  450. <xsl:choose>
  451. <xsl:when test="$label">
  452. <xsl:value-of select="$label"/>
  453. </xsl:when>
  454. <xsl:otherwise>
  455. <xsl:value-of select="$refDataItem"/>
  456. </xsl:otherwise>
  457. </xsl:choose>
  458. </key>
  459. <xsl:apply-templates select="*">
  460. <xsl:with-param name="posId">
  461. <xsl:value-of select="$listGroupId"/>
  462. </xsl:with-param>
  463. <xsl:with-param name="conditional">
  464. <xsl:value-of select="$conditional"/>
  465. </xsl:with-param>
  466. </xsl:apply-templates>
  467. </listGroup>
  468. </xsl:template>
  469. <xsl:template match="listHeader | listFooter">
  470. <xsl:param name="posId"/>
  471. <xsl:param name="conditional"/>
  472. <xsl:variable name="listSectionId">
  473. <xsl:value-of select="concat($posId,'/',name())"/>
  474. </xsl:variable>
  475. <xsl:element name="{name()}">
  476. <xsl:apply-templates select="listRows/listRow">
  477. <xsl:with-param name="posId">
  478. <xsl:value-of select="$listSectionId"/>
  479. </xsl:with-param>
  480. <xsl:with-param name="conditional">
  481. <xsl:value-of select="$conditional"/>
  482. </xsl:with-param>
  483. </xsl:apply-templates>
  484. </xsl:element>
  485. </xsl:template>
  486. <xsl:template match="listRow">
  487. <xsl:param name="posId"/>
  488. <xsl:param name="conditional"/>
  489. <xsl:variable name="listRowId">
  490. <xsl:value-of select="concat($posId,'/listRows/listRow')"/>
  491. </xsl:variable>
  492. <listRow>
  493. <xsl:apply-templates select="rowCells/rowCell">
  494. <xsl:with-param name="posId">
  495. <xsl:value-of select="$listRowId"/>
  496. </xsl:with-param>
  497. <xsl:with-param name="conditional">
  498. <xsl:value-of select="$conditional"/>
  499. </xsl:with-param>
  500. </xsl:apply-templates>
  501. </listRow>
  502. </xsl:template>
  503. <xsl:template match="rowCell">
  504. <xsl:param name="posId"/>
  505. <xsl:param name="conditional"/>
  506. <xsl:variable name="rowCellId">
  507. <xsl:value-of select="concat($posId,'/rowCells/rowCell/contents')"/>
  508. </xsl:variable>
  509. <rowCell>
  510. <xsl:choose>
  511. <xsl:when test="@colSpan">
  512. <xsl:attribute name="colSpan">
  513. <xsl:value-of select="@colSpan"/>
  514. </xsl:attribute>
  515. </xsl:when>
  516. <xsl:otherwise>
  517. <xsl:attribute name="colSpan">1</xsl:attribute>
  518. </xsl:otherwise>
  519. </xsl:choose>
  520. <xsl:apply-templates select="contents/*">
  521. <xsl:with-param name="posId">
  522. <xsl:value-of select="$rowCellId"/>
  523. </xsl:with-param>
  524. <xsl:with-param name="conditional">
  525. <xsl:value-of select="$conditional"/>
  526. </xsl:with-param>
  527. </xsl:apply-templates>
  528. </rowCell>
  529. </xsl:template>
  530. <!--
  531. <xsl:template match="list">
  532. <xsl:param name="posId"/>
  533. <xsl:param name="conditional"/>
  534. <xsl:variable name="countType">
  535. <xsl:value-of select="count(../list)"/>
  536. </xsl:variable>
  537. <xsl:variable name="refQuery">
  538. <xsl:value-of select="@refQuery"/>
  539. </xsl:variable>
  540. <xsl:variable name="index">
  541. <xsl:value-of select="1 + count(preceding-sibling::list)"/>
  542. </xsl:variable>
  543. <item>
  544. <posId>
  545. <xsl:choose>
  546. <xsl:when test="$countType &gt; 1">
  547. <xsl:value-of select="concat($posId,'/list[',$index,']')"/>
  548. </xsl:when>
  549. <xsl:otherwise>
  550. <xsl:value-of select="concat($posId,'/list')"/>
  551. </xsl:otherwise>
  552. </xsl:choose>
  553. </posId>
  554. <conditional>
  555. <xsl:choose>
  556. <xsl:when test="./conditionalRender">true</xsl:when>
  557. <xsl:otherwise>
  558. <xsl:value-of select="$conditional"/>
  559. </xsl:otherwise>
  560. </xsl:choose>
  561. </conditional>
  562. <MListFrame>
  563. -->
  564. <xsl:template match="TOC">
  565. <xsl:param name="posId"/>
  566. <xsl:variable name="countType">
  567. <xsl:value-of select="count(../TOC)"/>
  568. </xsl:variable>
  569. <xsl:variable name="index">
  570. <xsl:value-of select="1 + count(preceding-sibling::TOC)"/>
  571. </xsl:variable>
  572. <item>
  573. <LReference>
  574. <xsl:if test="@tocName">
  575. <ldx:id>
  576. <xsl:value-of select="@tocName"/>
  577. </ldx:id>
  578. </xsl:if>
  579. <posId>
  580. <xsl:choose>
  581. <xsl:when test="$countType &gt; 1">
  582. <xsl:value-of select="concat($posId,'/TOC[',$index,']')"/>
  583. </xsl:when>
  584. <xsl:otherwise>
  585. <xsl:value-of select="concat($posId,'/TOC')"/>
  586. </xsl:otherwise>
  587. </xsl:choose>
  588. </posId>
  589. </LReference>
  590. </item>
  591. </xsl:template>
  592. <xsl:template match="textItem">
  593. <xsl:param name="posId"/>
  594. <xsl:variable name="countType">
  595. <xsl:value-of select="count(../textItem)"/>
  596. </xsl:variable>
  597. <xsl:variable name="index">
  598. <xsl:value-of select="1 + count(preceding-sibling::textItem)+ count(preceding-sibling::date)+ count(preceding-sibling::time)"/>
  599. </xsl:variable>
  600. <item>
  601. <LReference>
  602. <xsl:if test="@name">
  603. <ldx:id>
  604. <xsl:value-of select="@name"/>
  605. </ldx:id>
  606. </xsl:if>
  607. <posId>
  608. <xsl:choose>
  609. <xsl:when test="$countType &gt; 1">
  610. <xsl:value-of select="concat($posId,'/textItem[',$index,']')"/>
  611. </xsl:when>
  612. <xsl:otherwise>
  613. <xsl:value-of select="concat($posId,'/textItem')"/>
  614. </xsl:otherwise>
  615. </xsl:choose>
  616. </posId>
  617. </LReference>
  618. </item>
  619. </xsl:template>
  620. <xsl:template match="time">
  621. <xsl:param name="posId"/>
  622. <xsl:variable name="countType">
  623. <xsl:value-of select="count(../textItem) + count(../date) + count(../time)"/>
  624. </xsl:variable>
  625. <xsl:variable name="index">
  626. <xsl:value-of select="1 + count(preceding-sibling::textItem)+ count(preceding-sibling::date)+ count(preceding-sibling::time)"/>
  627. </xsl:variable>
  628. <item>
  629. <LReference>
  630. <xsl:if test="@name">
  631. <ldx:id>
  632. <xsl:value-of select="@name"/>
  633. </ldx:id>
  634. </xsl:if>
  635. <posId>
  636. <xsl:choose>
  637. <xsl:when test="$countType &gt; 1">
  638. <xsl:value-of select="concat($posId,'/textItem[',$index,']')"/>
  639. </xsl:when>
  640. <xsl:otherwise>
  641. <xsl:value-of select="concat($posId,'/textItem')"/>
  642. </xsl:otherwise>
  643. </xsl:choose>
  644. </posId>
  645. </LReference>
  646. </item>
  647. </xsl:template>
  648. <xsl:template match="date">
  649. <xsl:param name="posId"/>
  650. <xsl:variable name="countType">
  651. <xsl:value-of select="count(../textItem) + count(../date) + count(../time)"/>
  652. </xsl:variable>
  653. <xsl:variable name="index">
  654. <xsl:value-of select="1 + count(preceding-sibling::textItem)+ count(preceding-sibling::date)+ count(preceding-sibling::time)"/>
  655. </xsl:variable>
  656. <item>
  657. <LReference>
  658. <xsl:if test="@name">
  659. <ldx:id>
  660. <xsl:value-of select="@name"/>
  661. </ldx:id>
  662. </xsl:if>
  663. <posId>
  664. <xsl:choose>
  665. <xsl:when test="$countType &gt; 1">
  666. <xsl:value-of select="concat($posId,'/textItem[',$index,']')"/>
  667. </xsl:when>
  668. <xsl:otherwise>
  669. <xsl:value-of select="concat($posId,'/textItem')"/>
  670. </xsl:otherwise>
  671. </xsl:choose>
  672. </posId>
  673. </LReference>
  674. </item>
  675. </xsl:template>
  676. <xsl:template match="image">
  677. <xsl:param name="posId"/>
  678. <xsl:variable name="countType">
  679. <xsl:value-of select="count(../image)"/>
  680. </xsl:variable>
  681. <xsl:variable name="index">
  682. <xsl:value-of select="1 + count(preceding-sibling::image)"/>
  683. </xsl:variable>
  684. <item>
  685. <LReference>
  686. <xsl:if test="@name">
  687. <ldx:id>
  688. <xsl:value-of select="@name"/>
  689. </ldx:id>
  690. </xsl:if>
  691. <posId>
  692. <xsl:choose>
  693. <xsl:when test="$countType &gt; 1">
  694. <xsl:value-of select="concat($posId,'/image[',$index,']')"/>
  695. </xsl:when>
  696. <xsl:otherwise>
  697. <xsl:value-of select="concat($posId,'/image')"/>
  698. </xsl:otherwise>
  699. </xsl:choose>
  700. </posId>
  701. </LReference>
  702. </item>
  703. </xsl:template>
  704. <xsl:template match="crosstab">
  705. <xsl:param name="posId"/>
  706. <xsl:variable name="countType">
  707. <xsl:value-of select="count(../crosstab)"/>
  708. </xsl:variable>
  709. <xsl:variable name="index">
  710. <xsl:value-of select="1 + count(preceding-sibling::crosstab)"/>
  711. </xsl:variable>
  712. <item>
  713. <LReference>
  714. <xsl:if test="@name">
  715. <ldx:id>
  716. <xsl:choose>
  717. <xsl:when test="function-available('ccs:getInfoPartName')">
  718. <xsl:value-of select="ccs:getInfoPartName(@name,'Crosstab')"/>
  719. </xsl:when>
  720. <xsl:otherwise>
  721. <xsl:value-of select="@name"/>
  722. </xsl:otherwise>
  723. </xsl:choose>
  724. </ldx:id>
  725. </xsl:if>
  726. <posId>
  727. <xsl:choose>
  728. <xsl:when test="$countType &gt; 1">
  729. <xsl:value-of select="concat($posId,'/crosstab[',$index,']')"/>
  730. </xsl:when>
  731. <xsl:otherwise>
  732. <xsl:value-of select="concat($posId,'/crosstab')"/>
  733. </xsl:otherwise>
  734. </xsl:choose>
  735. </posId>
  736. </LReference>
  737. </item>
  738. </xsl:template>
  739. <xsl:template match="repeaterTable">
  740. <xsl:param name="posId"/>
  741. <xsl:variable name="countType">
  742. <xsl:value-of select="count(../repeaterTable)"/>
  743. </xsl:variable>
  744. <xsl:variable name="index">
  745. <xsl:value-of select="1 + count(preceding-sibling::repeaterTable)"/>
  746. </xsl:variable>
  747. <xsl:variable name="rptId">
  748. <xsl:choose>
  749. <xsl:when test="$countType &gt; 1">
  750. <xsl:value-of select="concat($posId,'/repeaterTable[',$index,']')"/>
  751. </xsl:when>
  752. <xsl:otherwise>
  753. <xsl:value-of select="concat($posId,'/repeaterTable')"/>
  754. </xsl:otherwise>
  755. </xsl:choose>
  756. </xsl:variable>
  757. <item>
  758. <LRepeater>
  759. <xsl:if test="@name">
  760. <ldx:id>
  761. <xsl:value-of select="@name"/>
  762. </ldx:id>
  763. </xsl:if>
  764. <posId>
  765. <xsl:value-of select="$rptId"/>
  766. </posId>
  767. <layout>
  768. <xsl:apply-templates select="repeaterTableCell/contents/*">
  769. <xsl:with-param name="posId">
  770. <xsl:choose>
  771. <xsl:when test="$countType &gt; 1">
  772. <xsl:value-of select="concat($rptId,'/repeaterTableCell/contents[',$index,']')"/>
  773. </xsl:when>
  774. <xsl:otherwise>
  775. <xsl:value-of select="concat($rptId,'/repeaterTableCell/contents')"/>
  776. </xsl:otherwise>
  777. </xsl:choose>
  778. </xsl:with-param>
  779. </xsl:apply-templates>
  780. <xsl:if test="style/CSS">
  781. <CSSStyle>
  782. <xsl:value-of select="style/CSS/@value"/>
  783. </CSSStyle>
  784. </xsl:if>
  785. <xsl:apply-templates select="style/defaultStyles/*"/>
  786. </layout>
  787. </LRepeater>
  788. </item>
  789. </xsl:template>
  790. <xsl:template match="repeater">
  791. <xsl:param name="posId"/>
  792. <xsl:variable name="countType">
  793. <xsl:value-of select="count(../repeater)"/>
  794. </xsl:variable>
  795. <xsl:variable name="index">
  796. <xsl:value-of select="1 + count(preceding-sibling::repeater)"/>
  797. </xsl:variable>
  798. <xsl:variable name="rptId">
  799. <xsl:choose>
  800. <xsl:when test="$countType &gt; 1">
  801. <xsl:value-of select="concat($posId,'/repeater[',$index,']')"/>
  802. </xsl:when>
  803. <xsl:otherwise>
  804. <xsl:value-of select="concat($posId,'/repeater')"/>
  805. </xsl:otherwise>
  806. </xsl:choose>
  807. </xsl:variable>
  808. <item>
  809. <LRepeater>
  810. <xsl:if test="@name">
  811. <ldx:id>
  812. <xsl:value-of select="@name"/>
  813. </ldx:id>
  814. </xsl:if>
  815. <posId>
  816. <xsl:value-of select="$rptId"/>
  817. </posId>
  818. <layout>
  819. <xsl:apply-templates select="contents/*">
  820. <xsl:with-param name="posId">
  821. <xsl:choose>
  822. <xsl:when test="$countType &gt; 1">
  823. <xsl:value-of select="concat($posId,'/repeater/contents[',$index,']')"/>
  824. </xsl:when>
  825. <xsl:otherwise>
  826. <xsl:value-of select="concat($posId,'/repeater/contents')"/>
  827. </xsl:otherwise>
  828. </xsl:choose>
  829. </xsl:with-param>
  830. </xsl:apply-templates>
  831. <xsl:if test="style/CSS">
  832. <CSSStyle>
  833. <xsl:value-of select="style/CSS/@value"/>
  834. </CSSStyle>
  835. </xsl:if>
  836. <xsl:apply-templates select="style/defaultStyles/*"/>
  837. </layout>
  838. </LRepeater>
  839. </item>
  840. </xsl:template>
  841. <xsl:template match="hyperlink">
  842. <xsl:param name="posId"/>
  843. <xsl:variable name="countType">
  844. <xsl:value-of select="count(../hyperlink)"/>
  845. </xsl:variable>
  846. <xsl:variable name="index">
  847. <xsl:value-of select="1 + count(preceding-sibling::hyperlink)"/>
  848. </xsl:variable>
  849. <item>
  850. <LReference>
  851. <xsl:if test="@name">
  852. <ldx:id>
  853. <xsl:value-of select="@name"/>
  854. </ldx:id>
  855. </xsl:if>
  856. <posId>
  857. <xsl:choose>
  858. <xsl:when test="$countType &gt; 1">
  859. <xsl:value-of select="concat($posId,'/hyperlink[',$index,']')"/>
  860. </xsl:when>
  861. <xsl:otherwise>
  862. <xsl:value-of select="concat($posId,'/hyperlink')"/>
  863. </xsl:otherwise>
  864. </xsl:choose>
  865. </posId>
  866. </LReference>
  867. </item>
  868. </xsl:template>
  869. <xsl:template match="button">
  870. <!--Not yet handled-->
  871. </xsl:template>
  872. <xsl:template match="promptButton">
  873. <!--Not yet handled-->
  874. </xsl:template>
  875. <xsl:template match="HTMLItem">
  876. <xsl:param name="posId"/>
  877. <xsl:variable name="countType">
  878. <xsl:value-of select="count(../HTMLItem)"/>
  879. </xsl:variable>
  880. <xsl:variable name="index">
  881. <xsl:value-of select="1 + count(preceding-sibling::HTMLItem)"/>
  882. </xsl:variable>
  883. <item>
  884. <LReference>
  885. <xsl:if test="@name">
  886. <ldx:id>
  887. <xsl:value-of select="@name"/>
  888. </ldx:id>
  889. </xsl:if>
  890. <posId>
  891. <xsl:choose>
  892. <xsl:when test="$countType &gt; 1">
  893. <xsl:value-of select="concat($posId,'/HTMLItem[',$index,']')"/>
  894. </xsl:when>
  895. <xsl:otherwise>
  896. <xsl:value-of select="concat($posId,'/HTMLItem')"/>
  897. </xsl:otherwise>
  898. </xsl:choose>
  899. </posId>
  900. </LReference>
  901. </item>
  902. </xsl:template>
  903. <xsl:template match="customContent">
  904. <xsl:param name="posId"/>
  905. <xsl:variable name="countType">
  906. <xsl:value-of select="count(../customContent)"/>
  907. </xsl:variable>
  908. <xsl:variable name="index">
  909. <xsl:value-of select="1 + count(preceding-sibling::customContent)"/>
  910. </xsl:variable>
  911. <xsl:call-template name="richTextItem">
  912. <xsl:with-param name="posId" select="concat($posId,'/customContent')"/>
  913. <xsl:with-param name="index" select="$index"/>
  914. <xsl:with-param name="countType" select="$countType"/>
  915. </xsl:call-template>
  916. </xsl:template>
  917. <xsl:template match="richTextItem">
  918. <xsl:param name="posId"/>
  919. <xsl:variable name="countType">
  920. <xsl:value-of select="count(../richTextItem)"/>
  921. </xsl:variable>
  922. <xsl:variable name="index">
  923. <xsl:value-of select="1 + count(preceding-sibling::richTextItem)"/>
  924. </xsl:variable>
  925. <xsl:call-template name="richTextItem">
  926. <xsl:with-param name="posId" select="concat($posId,'/richTextItem')"/>
  927. <xsl:with-param name="index" select="$index"/>
  928. <xsl:with-param name="countType" select="$countType"/>
  929. </xsl:call-template>
  930. </xsl:template>
  931. <xsl:template name="richTextItem">
  932. <xsl:param name="posId"/>
  933. <xsl:param name="index"/>
  934. <xsl:param name="countType"/>
  935. <item>
  936. <LReference>
  937. <xsl:if test="@name">
  938. <ldx:id>
  939. <xsl:value-of select="@name"/>
  940. </ldx:id>
  941. </xsl:if>
  942. <posId>
  943. <xsl:choose>
  944. <xsl:when test="$countType &gt; 1">
  945. <xsl:value-of select="concat($posId,'[',$index,']')"/>
  946. </xsl:when>
  947. <xsl:otherwise>
  948. <xsl:value-of select="$posId"/>
  949. </xsl:otherwise>
  950. </xsl:choose>
  951. </posId>
  952. </LReference>
  953. </item>
  954. </xsl:template>
  955. <xsl:template match="bookmark">
  956. <xsl:param name="posId"/>
  957. <xsl:variable name="countType">
  958. <xsl:value-of select="count(../bookmark)"/>
  959. </xsl:variable>
  960. <xsl:variable name="index">
  961. <xsl:value-of select="1 + count(preceding-sibling::bookmark)"/>
  962. </xsl:variable>
  963. <item>
  964. <LReference>
  965. <xsl:if test="@name">
  966. <ldx:id>
  967. <xsl:value-of select="@name"/>
  968. </ldx:id>
  969. </xsl:if>
  970. <posId>
  971. <xsl:choose>
  972. <xsl:when test="$countType &gt; 1">
  973. <xsl:value-of select="concat($posId,'/bookmark[',$index,']')"/>
  974. </xsl:when>
  975. <xsl:otherwise>
  976. <xsl:value-of select="concat($posId,'/bookmark')"/>
  977. </xsl:otherwise>
  978. </xsl:choose>
  979. </posId>
  980. </LReference>
  981. </item>
  982. </xsl:template>
  983. <xsl:template match="TOCEntry">
  984. <xsl:param name="posId"/>
  985. <xsl:variable name="countType">
  986. <xsl:value-of select="count(../TOCEntry)"/>
  987. </xsl:variable>
  988. <xsl:variable name="index">
  989. <xsl:value-of select="1 + count(preceding-sibling::TOCEntry)"/>
  990. </xsl:variable>
  991. <item>
  992. <!-- TOCEntry items are also mapped to bookmark object -->
  993. <!-- Note: neither TOCEntry nor bookmark have name attrbitues, so id will be empty -->
  994. <LReference>
  995. <xsl:if test="@name">
  996. <ldx:id>
  997. <xsl:value-of select="@name"/>
  998. </ldx:id>
  999. </xsl:if>
  1000. <posId>
  1001. <xsl:choose>
  1002. <xsl:when test="$countType &gt; 1">
  1003. <xsl:value-of select="concat($posId,'/TOCEntry[',$index,']')"/>
  1004. </xsl:when>
  1005. <xsl:otherwise>
  1006. <xsl:value-of select="concat($posId,'/TOCEntry')"/>
  1007. </xsl:otherwise>
  1008. </xsl:choose>
  1009. </posId>
  1010. </LReference>
  1011. </item>
  1012. </xsl:template>
  1013. <xsl:template match="fieldSet">
  1014. <xsl:param name="posId"/>
  1015. <xsl:variable name="countType">
  1016. <xsl:value-of select="count(../fieldset)"/>
  1017. </xsl:variable>
  1018. <xsl:variable name="index">
  1019. <xsl:value-of select="1 + count(preceding-sibling::fieldset)"/>
  1020. </xsl:variable>
  1021. <xsl:apply-templates select="fieldSetCaption/contents/*">
  1022. <xsl:with-param name="posId">
  1023. <xsl:choose>
  1024. <xsl:when test="$countType &gt; 1">
  1025. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption[',$index,']/contents')"/>
  1026. </xsl:when>
  1027. <xsl:otherwise>
  1028. <xsl:value-of select="concat($posId,'/fieldSet/fieldSetCaption/contents')"/>
  1029. </xsl:otherwise>
  1030. </xsl:choose>
  1031. </xsl:with-param>
  1032. </xsl:apply-templates>
  1033. <xsl:apply-templates select="contents/*">
  1034. <xsl:with-param name="posId">
  1035. <xsl:choose>
  1036. <xsl:when test="$countType &gt; 1">
  1037. <xsl:value-of select="concat($posId,'/fieldSet[',$index,']/contents')"/>
  1038. </xsl:when>
  1039. <xsl:otherwise>
  1040. <xsl:value-of select="concat($posId,'/fieldSet/contents')"/>
  1041. </xsl:otherwise>
  1042. </xsl:choose>
  1043. </xsl:with-param>
  1044. </xsl:apply-templates>
  1045. </xsl:template>
  1046. <xsl:template match="conditionalBlocks">
  1047. <xsl:param name="posId"/>
  1048. <xsl:variable name="countType">
  1049. <xsl:value-of select="count(../conditionalBlocks)"/>
  1050. </xsl:variable>
  1051. <xsl:variable name="index">
  1052. <xsl:value-of select="1 + count(preceding-sibling::conditionalBlocks)"/>
  1053. </xsl:variable>
  1054. <xsl:apply-templates select="./conditionalBlockDefault/contents/*">
  1055. <xsl:with-param name="posId">
  1056. <xsl:value-of select="concat($posId,'/conditionalBlockDefault/contents')"/>
  1057. </xsl:with-param>
  1058. </xsl:apply-templates>
  1059. <xsl:for-each select="./conditionalBlockCases/conditionalBlock">
  1060. <xsl:apply-templates select="./contents/*">
  1061. <xsl:with-param name="posId">
  1062. <xsl:choose>
  1063. <xsl:when test="count(../conditionalBlock) &gt; 1">
  1064. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock[',1 + count(preceding-sibling::conditionalBlock),']/contents')"/>
  1065. </xsl:when>
  1066. <xsl:otherwise>
  1067. <xsl:value-of select="concat($posId,'/conditionalBlockCases/conditionalBlock/contents')"/>
  1068. </xsl:otherwise>
  1069. </xsl:choose>
  1070. </xsl:with-param>
  1071. </xsl:apply-templates>
  1072. </xsl:for-each>
  1073. </xsl:template>
  1074. <xsl:template match="layoutComponentRef">
  1075. <xsl:param name="conditional"/>
  1076. <xsl:param name="posId"/>
  1077. <xsl:variable name="countType">
  1078. <xsl:value-of select="count(../layoutComponentRef)"/>
  1079. </xsl:variable>
  1080. <xsl:variable name="index">
  1081. <xsl:value-of select="1 + count(preceding-sibling::layoutComponentRef)"/>
  1082. </xsl:variable>
  1083. <!-- LCRs will be handled in a future release -->
  1084. </xsl:template>
  1085. <xsl:template match="CMMMap">
  1086. <xsl:param name="posId"/>
  1087. <xsl:variable name="countType">
  1088. <xsl:value-of select="count(../CMMMap)"/>
  1089. </xsl:variable>
  1090. <xsl:variable name="index">
  1091. <xsl:value-of select="1 + count(preceding-sibling::CMMMap)"/>
  1092. </xsl:variable>
  1093. <item>
  1094. <LReference>
  1095. <xsl:if test="@cmmID">
  1096. <ldx:id>
  1097. <xsl:value-of select="@cmmID"/>
  1098. </ldx:id>
  1099. </xsl:if>
  1100. <posId>
  1101. <xsl:choose>
  1102. <xsl:when test="$countType &gt; 1">
  1103. <xsl:value-of select="concat($posId,'/CMMMap[',$index,']')"/>
  1104. </xsl:when>
  1105. <xsl:otherwise>
  1106. <xsl:value-of select="concat($posId,'/CMMMap')"/>
  1107. </xsl:otherwise>
  1108. </xsl:choose>
  1109. </posId>
  1110. </LReference>
  1111. </item>
  1112. </xsl:template>
  1113. <xsl:template match="asOfTime">
  1114. <!--Not yet handled-->
  1115. </xsl:template>
  1116. <xsl:template match="singleton">
  1117. <xsl:param name="posId"/>
  1118. <xsl:variable name="countType">
  1119. <xsl:value-of select="count(../singleton)"/>
  1120. </xsl:variable>
  1121. <xsl:variable name="index">
  1122. <xsl:value-of select="1 + count(preceding-sibling::singleton)"/>
  1123. </xsl:variable>
  1124. <xsl:apply-templates select="contents/*">
  1125. <xsl:with-param name="posId">
  1126. <xsl:choose>
  1127. <xsl:when test="$countType &gt; 1">
  1128. <xsl:value-of select="concat($posId,'/singleton[',$index,']/contents')"/>
  1129. </xsl:when>
  1130. <xsl:otherwise>
  1131. <xsl:value-of select="concat($posId,'/singleton/contents')"/>
  1132. </xsl:otherwise>
  1133. </xsl:choose>
  1134. </xsl:with-param>
  1135. </xsl:apply-templates>
  1136. </xsl:template>
  1137. <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">
  1138. <xsl:param name="posId"/>
  1139. <item>
  1140. <LReference>
  1141. <xsl:if test="@name">
  1142. <ldx:id>
  1143. <xsl:choose>
  1144. <xsl:when test="function-available('ccs:getInfoPartName')">
  1145. <xsl:value-of select="ccs:getInfoPartName(@name,'Chart')"/>
  1146. </xsl:when>
  1147. <xsl:otherwise>
  1148. <xsl:value-of select="@name"/>
  1149. </xsl:otherwise>
  1150. </xsl:choose>
  1151. </ldx:id>
  1152. </xsl:if>
  1153. <posId>
  1154. <xsl:choose>
  1155. <xsl:when test="name() = 'pieChart'">
  1156. <xsl:choose>
  1157. <xsl:when test="count(../pieChart) &gt; 1">
  1158. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::pieChart),']')"/>
  1159. </xsl:when>
  1160. <xsl:otherwise>
  1161. <xsl:value-of select="concat($posId,'/pieChart')"/>
  1162. </xsl:otherwise>
  1163. </xsl:choose>
  1164. </xsl:when>
  1165. <xsl:when test="name() = 'paretoChart'">
  1166. <xsl:choose>
  1167. <xsl:when test="count(../paretoChart) &gt; 1">
  1168. <xsl:value-of select="concat($posId,'/paretoChart[',1 + count(preceding-sibling::paretoChart),']')"/>
  1169. </xsl:when>
  1170. <xsl:otherwise>
  1171. <xsl:value-of select="concat($posId,'/paretoChart')"/>
  1172. </xsl:otherwise>
  1173. </xsl:choose>
  1174. </xsl:when>
  1175. <xsl:when test="name() = 'scatterChart'">
  1176. <xsl:choose>
  1177. <xsl:when test="count(../scatterChart) &gt; 1">
  1178. <xsl:value-of select="concat($posId,'/scatterChart[',1 + count(preceding-sibling::scatterChart),']')"/>
  1179. </xsl:when>
  1180. <xsl:otherwise>
  1181. <xsl:value-of select="concat($posId,'/scatterChart')"/>
  1182. </xsl:otherwise>
  1183. </xsl:choose>
  1184. </xsl:when>
  1185. <xsl:when test="name() = 'polarChart'">
  1186. <xsl:choose>
  1187. <xsl:when test="count(../polarChart) &gt; 1">
  1188. <xsl:value-of select="concat($posId,'/polarChart[',1 + count(preceding-sibling::polarChart),']')"/>
  1189. </xsl:when>
  1190. <xsl:otherwise>
  1191. <xsl:value-of select="concat($posId,'/polarChart')"/>
  1192. </xsl:otherwise>
  1193. </xsl:choose>
  1194. </xsl:when>
  1195. <xsl:when test="name() = 'radarChart'">
  1196. <xsl:choose>
  1197. <xsl:when test="count(../radarChart) &gt; 1">
  1198. <xsl:value-of select="concat($posId,'/radarChart[',1 + count(preceding-sibling::radarChart),']')"/>
  1199. </xsl:when>
  1200. <xsl:otherwise>
  1201. <xsl:value-of select="concat($posId,'/radarChart')"/>
  1202. </xsl:otherwise>
  1203. </xsl:choose>
  1204. </xsl:when>
  1205. <xsl:when test="name() = 'progressiveChart'">
  1206. <xsl:choose>
  1207. <xsl:when test="count(../progressiveChart) &gt; 1">
  1208. <xsl:value-of select="concat($posId,'/progressiveChart[',1 + count(preceding-sibling::progressiveChart),']')"/>
  1209. </xsl:when>
  1210. <xsl:otherwise>
  1211. <xsl:value-of select="concat($posId,'/progressiveChart')"/>
  1212. </xsl:otherwise>
  1213. </xsl:choose>
  1214. </xsl:when>
  1215. <xsl:when test="name() = 'combinationChart'">
  1216. <xsl:choose>
  1217. <xsl:when test="count(../combinationChart) &gt; 1">
  1218. <xsl:value-of select="concat($posId,'/combinationChart[',1 + count(preceding-sibling::combinationChart),']')"/>
  1219. </xsl:when>
  1220. <xsl:otherwise>
  1221. <xsl:value-of select="concat($posId,'/combinationChart')"/>
  1222. </xsl:otherwise>
  1223. </xsl:choose>
  1224. </xsl:when>
  1225. <xsl:when test="name() = 'bubbleChart'">
  1226. <xsl:choose>
  1227. <xsl:when test="count(../bubbleChart) &gt; 1">
  1228. <xsl:value-of select="concat($posId,'/bubbleChart[',1 + count(preceding-sibling::bubbleChart),']')"/>
  1229. </xsl:when>
  1230. <xsl:otherwise>
  1231. <xsl:value-of select="concat($posId,'/bubbleChart')"/>
  1232. </xsl:otherwise>
  1233. </xsl:choose>
  1234. </xsl:when>
  1235. <xsl:when test="name() = 'threeDCombinationChart'">
  1236. <xsl:choose>
  1237. <xsl:when test="count(../threeDCombinationChart) &gt; 1">
  1238. <xsl:value-of select="concat($posId,'/threeDCombinationChart[',1 + count(preceding-sibling::threeDCombinationChart),']')"/>
  1239. </xsl:when>
  1240. <xsl:otherwise>
  1241. <xsl:value-of select="concat($posId,'/threeDCombinationChart')"/>
  1242. </xsl:otherwise>
  1243. </xsl:choose>
  1244. </xsl:when>
  1245. <xsl:when test="name() = 'threeDScatterChart'">
  1246. <xsl:choose>
  1247. <xsl:when test="count(../threeDScatterChart) &gt; 1">
  1248. <xsl:value-of select="concat($posId,'/threeDScatterChart[',1 + count(preceding-sibling::threeDScatterChart),']')"/>
  1249. </xsl:when>
  1250. <xsl:otherwise>
  1251. <xsl:value-of select="concat($posId,'/threeDScatterChart')"/>
  1252. </xsl:otherwise>
  1253. </xsl:choose>
  1254. </xsl:when>
  1255. <xsl:when test="name() = 'gaugeChart'">
  1256. <xsl:choose>
  1257. <xsl:when test="count(../gaugeChart) &gt; 1">
  1258. <xsl:value-of select="concat($posId,'/gaugeChart[',1 + count(preceding-sibling::gaugeChart),']')"/>
  1259. </xsl:when>
  1260. <xsl:otherwise>
  1261. <xsl:value-of select="concat($posId,'/gaugeChart')"/>
  1262. </xsl:otherwise>
  1263. </xsl:choose>
  1264. </xsl:when>
  1265. <xsl:when test="name() = 'mapChart'">
  1266. <xsl:choose>
  1267. <xsl:when test="count(../mapChart) &gt; 1">
  1268. <xsl:value-of select="concat($posId,'/mapChart[',1 + count(preceding-sibling::mapChart),']')"/>
  1269. </xsl:when>
  1270. <xsl:otherwise>
  1271. <xsl:value-of select="concat($posId,'/mapChart')"/>
  1272. </xsl:otherwise>
  1273. </xsl:choose>
  1274. </xsl:when>
  1275. <xsl:when test="name() = 'metricsChart'">
  1276. <xsl:choose>
  1277. <xsl:when test="count(../metricsChart) &gt; 1">
  1278. <xsl:value-of select="concat($posId,'/metricsChart[',1 + count(preceding-sibling::metricsChart),']')"/>
  1279. </xsl:when>
  1280. <xsl:otherwise>
  1281. <xsl:value-of select="concat($posId,'/metricsChart')"/>
  1282. </xsl:otherwise>
  1283. </xsl:choose>
  1284. </xsl:when>
  1285. <xsl:when test="name() = 'marimekkoChart'">
  1286. <xsl:choose>
  1287. <xsl:when test="count(../marimekkoChart) &gt; 1">
  1288. <xsl:value-of select="concat($posId,'/marimekkoChart[',1 + count(preceding-sibling::marimekkoChart),']')"/>
  1289. </xsl:when>
  1290. <xsl:otherwise>
  1291. <xsl:value-of select="concat($posId,'/marimekkoChart')"/>
  1292. </xsl:otherwise>
  1293. </xsl:choose>
  1294. </xsl:when>
  1295. <xsl:when test="name() = 'winLossChart'">
  1296. <xsl:choose>
  1297. <xsl:when test="count(../winLossChart) &gt; 1">
  1298. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::winLossChart),']')"/>
  1299. </xsl:when>
  1300. <xsl:otherwise>
  1301. <xsl:value-of select="concat($posId,'/winLossChart')"/>
  1302. </xsl:otherwise>
  1303. </xsl:choose>
  1304. </xsl:when>
  1305. <xsl:when test="name() = 'v2_combinationChart'">
  1306. <xsl:choose>
  1307. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1308. <xsl:value-of select="concat($posId,'/winLossChart[',1 + count(preceding-sibling::v2_combinationChart),']')"/>
  1309. </xsl:when>
  1310. <xsl:otherwise>
  1311. <xsl:value-of select="concat($posId,'/v2_combinationChart')"/>
  1312. </xsl:otherwise>
  1313. </xsl:choose>
  1314. </xsl:when>
  1315. <xsl:when test="name() = 'v2_scatterChart'">
  1316. <xsl:choose>
  1317. <xsl:when test="count(../v2_scatterChart) &gt; 1">
  1318. <xsl:value-of select="concat($posId,'/v2_scatterChart[',1 + count(preceding-sibling::v2_scatterChart),']')"/>
  1319. </xsl:when>
  1320. <xsl:otherwise>
  1321. <xsl:value-of select="concat($posId,'/v2_schatterChart')"/>
  1322. </xsl:otherwise>
  1323. </xsl:choose>
  1324. </xsl:when>
  1325. <xsl:when test="name() = 'v2_pieChart'">
  1326. <xsl:choose>
  1327. <xsl:when test="count(../v2_combinationChart) &gt; 1">
  1328. <xsl:value-of select="concat($posId,'/pieChart[',1 + count(preceding-sibling::v2_pieChart),']')"/>
  1329. </xsl:when>
  1330. <xsl:otherwise>
  1331. <xsl:value-of select="concat($posId,'/v2_pieChart')"/>
  1332. </xsl:otherwise>
  1333. </xsl:choose>
  1334. </xsl:when>
  1335. <xsl:when test="name() = 'v2_guageChart'">
  1336. <xsl:choose>
  1337. <xsl:when test="count(../v2_guageChart) &gt; 1">
  1338. <xsl:value-of select="concat($posId,'/v2_guageChart[',1 + count(preceding-sibling::v2_guageChart),']')"/>
  1339. </xsl:when>
  1340. <xsl:otherwise>
  1341. <xsl:value-of select="concat($posId,'/v2_guageChart')"/>
  1342. </xsl:otherwise>
  1343. </xsl:choose>
  1344. </xsl:when>
  1345. <xsl:when test="name() = 'v2_matrixChart'">
  1346. <xsl:choose>
  1347. <xsl:when test="count(../v2_matrixChart) &gt; 1">
  1348. <xsl:value-of select="concat($posId,'/v2_matrixChart[',1 + count(preceding-sibling::v2_matrixChart),']')"/>
  1349. </xsl:when>
  1350. <xsl:otherwise>
  1351. <xsl:value-of select="concat($posId,'/v2_matrixChart')"/>
  1352. </xsl:otherwise>
  1353. </xsl:choose>
  1354. </xsl:when>
  1355. <xsl:when test="name() = 'v2_progressiveChart'">
  1356. <xsl:choose>
  1357. <xsl:when test="count(../v2_progressiveChart) &gt; 1">
  1358. <xsl:value-of select="concat($posId,'/v2_progressiveChart[',1 + count(preceding-sibling::v2_progressiveChart),']')"/>
  1359. </xsl:when>
  1360. <xsl:otherwise>
  1361. <xsl:value-of select="concat($posId,'/v2_progressiveChart')"/>
  1362. </xsl:otherwise>
  1363. </xsl:choose>
  1364. </xsl:when>
  1365. <xsl:when test="name() = 'v2_paretoChart'">
  1366. <xsl:choose>
  1367. <xsl:when test="count(../v2_paretoChart) &gt; 1">
  1368. <xsl:value-of select="concat($posId,'/v2_paretoChart[',1 + count(preceding-sibling::v2_paretoChart),']')"/>
  1369. </xsl:when>
  1370. <xsl:otherwise>
  1371. <xsl:value-of select="concat($posId,'/v2_paretoChart')"/>
  1372. </xsl:otherwise>
  1373. </xsl:choose>
  1374. </xsl:when>
  1375. <xsl:when test="name() = 'v2_bubbleChart'">
  1376. <xsl:choose>
  1377. <xsl:when test="count(../v2_bubbleChart) &gt; 1">
  1378. <xsl:value-of select="concat($posId,'/v2_bubbleChart[',1 + count(preceding-sibling::v2_bubbleChart),']')"/>
  1379. </xsl:when>
  1380. <xsl:otherwise>
  1381. <xsl:value-of select="concat($posId,'/v2_bubbleChart')"/>
  1382. </xsl:otherwise>
  1383. </xsl:choose>
  1384. </xsl:when>
  1385. <xsl:when test="name() = 'v2_repeaterChart'">
  1386. <xsl:choose>
  1387. <xsl:when test="count(../v2_repeaterChart) &gt; 1">
  1388. <xsl:value-of select="concat($posId,'/v2_repeaterChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1389. </xsl:when>
  1390. <xsl:otherwise>
  1391. <xsl:value-of select="concat($posId,'/v2_repeaterChart')"/>
  1392. </xsl:otherwise>
  1393. </xsl:choose>
  1394. </xsl:when>
  1395. <xsl:when test="name() = 'v2_bulletChart'">
  1396. <xsl:choose>
  1397. <xsl:when test="count(../v2_bulletChart) &gt; 1">
  1398. <xsl:value-of select="concat($posId,'/v2_bulletChart[',1 + count(preceding-sibling::v2_repeaterChart),']')"/>
  1399. </xsl:when>
  1400. <xsl:otherwise>
  1401. <xsl:value-of select="concat($posId,'/v2_bulletChart')"/>
  1402. </xsl:otherwise>
  1403. </xsl:choose>
  1404. </xsl:when>
  1405. <xsl:when test="name() = 'viz'">
  1406. <xsl:choose>
  1407. <xsl:when test="count(../viz) &gt; 1">
  1408. <xsl:value-of select="concat($posId,'/viz[',1 + count(preceding-sibling::viz),']')"/>
  1409. </xsl:when>
  1410. <xsl:otherwise>
  1411. <xsl:value-of select="concat($posId,'/viz')"/>
  1412. </xsl:otherwise>
  1413. </xsl:choose>
  1414. </xsl:when>
  1415. <xsl:otherwise>
  1416. <xsl:value-of select="concat($posId,'/unknownChartType')"/>
  1417. </xsl:otherwise>
  1418. </xsl:choose>
  1419. </posId>
  1420. </LReference>
  1421. </item>
  1422. </xsl:template>
  1423. <xsl:template match="defaultStyle">
  1424. <RefStyle>
  1425. <xsl:value-of select="@refStyle"/>
  1426. </RefStyle>
  1427. </xsl:template>
  1428. <xsl:template match="classStyle">
  1429. <ClassStyle>
  1430. <Name>
  1431. <xsl:value-of select="@name"/>
  1432. </Name>
  1433. <Value>
  1434. <xsl:value-of select="CSS/@value"/>
  1435. </Value>
  1436. </ClassStyle>
  1437. </xsl:template>
  1438. </xsl:stylesheet>