V5ReportEngine.xsl 99 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rsvp
  5. (C) Copyright IBM Corp. 2005, 2020
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rsext="xalan://com.cognos.reportserver.ext.RSExt" version="1.0" extension-element-prefixes="rsext">
  10. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  11. <xsl:param name="namespaceId" select="''"/>
  12. <xsl:param name="CVGateway" select="''"/>
  13. <xsl:variable name="sDelimiter"><xsl:text>&#xA;</xsl:text></xsl:variable>
  14. <xsl:variable name="viewerID">
  15. <xsl:choose>
  16. <xsl:when test="$CognosViewerID=''"><xsl:value-of select="'_THIS_'"/></xsl:when>
  17. <xsl:otherwise><xsl:value-of select="$CognosViewerID"/></xsl:otherwise>
  18. </xsl:choose>
  19. </xsl:variable>
  20. <xsl:variable name="vUseStyleId">
  21. <xsl:choose>
  22. <xsl:when test="$email='yes'">false</xsl:when>
  23. <xsl:when test="not(/Document/styleOptions/cssOptStyle)">false</xsl:when>
  24. <xsl:otherwise>true</xsl:otherwise>
  25. </xsl:choose>
  26. </xsl:variable>
  27. <xsl:key name="getOptStyle" match="cssOptStyle" use="@styleId"/>
  28. <xsl:template name="GenCommonAttributes">
  29. <xsl:variable name="sBackgroundImage">
  30. <xsl:if test="@bgsrc or @bgsrcemail">
  31. <xsl:choose>
  32. <xsl:when test="$chartSrc = 'src'">
  33. <xsl:text disable-output-escaping="yes">background-image:url("</xsl:text>
  34. <xsl:choose>
  35. <xsl:when test="starts-with(@bgsrc, '?b_action')">
  36. <xsl:value-of select="$CVGateway"/><xsl:value-of select="@bgsrc"/>
  37. </xsl:when>
  38. <xsl:otherwise>
  39. <xsl:value-of select="@bgsrc"/>
  40. </xsl:otherwise>
  41. </xsl:choose>
  42. <xsl:text disable-output-escaping="yes">");</xsl:text>
  43. </xsl:when>
  44. <xsl:when test="$chartSrc = 'srcemail'">
  45. <xsl:text disable-output-escaping="yes">background-image:url(</xsl:text>
  46. <xsl:value-of select="@bgsrcemail"/>
  47. <xsl:text disable-output-escaping="yes">);</xsl:text>
  48. </xsl:when>
  49. </xsl:choose>
  50. </xsl:if>
  51. </xsl:variable>
  52. <xsl:choose>
  53. <xsl:when test="@style">
  54. <!-- Add cursor to style if bookmarkRef defined -->
  55. <xsl:attribute name="style"><xsl:for-each select="@style"><xsl:value-of select="."/>;</xsl:for-each><!-- Use pointer and hand (in that order) to get NS and IE working --><xsl:if test="@bookmarkRef">cursor:pointer;cursor:hand;</xsl:if><xsl:value-of select="$sBackgroundImage"/></xsl:attribute>
  56. </xsl:when>
  57. <xsl:otherwise>
  58. <!-- no style, check for bookmarkRef. This avoids generating two style attributes -->
  59. <xsl:choose>
  60. <xsl:when test="@bookmarkRef">
  61. <xsl:attribute name="style"><xsl:text>cursor:pointer;cursor:hand;</xsl:text><xsl:value-of select="$sBackgroundImage"/></xsl:attribute>
  62. </xsl:when>
  63. <xsl:when test="$sBackgroundImage != ''">
  64. <xsl:attribute name="style"><xsl:value-of select="$sBackgroundImage"/></xsl:attribute>
  65. </xsl:when>
  66. </xsl:choose>
  67. </xsl:otherwise>
  68. </xsl:choose>
  69. <xsl:if test="@bookmarkRef">
  70. <xsl:variable name="location">
  71. <xsl:text>'</xsl:text>
  72. <xsl:value-of select="rsext:javascriptencode(rsext:replace(rsext:urlencode(string(@bookmarkRef)), '+', '-'))"/>
  73. <xsl:text>'</xsl:text>
  74. <xsl:if test="@bookmarkPage">
  75. <xsl:text>, '</xsl:text>
  76. <xsl:value-of select="@bookmarkPage"/>
  77. <xsl:text>', oCV</xsl:text>
  78. <xsl:value-of select="$viewerID"/>
  79. </xsl:if>
  80. </xsl:variable>
  81. <xsl:choose>
  82. <xsl:when test="$strict = 'true'">
  83. <xsl:attribute name="onclick">docLocation(<xsl:value-of select="$location"/>);</xsl:attribute>
  84. <xsl:attribute name="onkeypress">if (event.keyCode == 13) {docLocation(<xsl:value-of select="$location"/>);}</xsl:attribute>
  85. </xsl:when>
  86. <xsl:otherwise>
  87. <xsl:attribute name="onClick">docLocation(<xsl:value-of select="$location"/>);</xsl:attribute>
  88. <xsl:attribute name="onKeyPress">if (event.keyCode == 13) {docLocation(<xsl:value-of select="$location"/>);}</xsl:attribute>
  89. <xsl:attribute name="tabIndex">0</xsl:attribute>
  90. <xsl:if test="$accessible='true'">
  91. <xsl:attribute name="role">link</xsl:attribute>
  92. </xsl:if>
  93. </xsl:otherwise>
  94. </xsl:choose>
  95. </xsl:if>
  96. <xsl:choose>
  97. <xsl:when test="not(@class) and @styleId and @layoutClass">
  98. <xsl:choose>
  99. <xsl:when test="$vUseStyleId='true'">
  100. <xsl:attribute name="class"><xsl:value-of select="@styleId"/></xsl:attribute>
  101. </xsl:when>
  102. <xsl:otherwise>
  103. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/></xsl:attribute>
  104. </xsl:otherwise>
  105. </xsl:choose>
  106. </xsl:when>
  107. <xsl:when test="not(@class) and not(@styleId) and @layoutClass and $appSupport='false'">
  108. </xsl:when>
  109. <xsl:when test="@styleId and @class">
  110. <xsl:choose>
  111. <xsl:when test="$vUseStyleId='true'">
  112. <xsl:attribute name="class"><xsl:value-of select="@class"/><xsl:text> </xsl:text><xsl:value-of select="@styleId"/></xsl:attribute>
  113. </xsl:when>
  114. <xsl:otherwise>
  115. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/></xsl:attribute>
  116. <xsl:copy-of select="@class"/>
  117. </xsl:otherwise>
  118. </xsl:choose>
  119. </xsl:when>
  120. <xsl:when test="not(@styleId) and @class">
  121. <xsl:copy-of select="@class"/>
  122. </xsl:when>
  123. <xsl:when test="not(@class) and not(@layoutClass) and @styleId">
  124. <xsl:choose>
  125. <xsl:when test="$vUseStyleId='true'">
  126. <xsl:attribute name="class"><xsl:value-of select="@styleId"/></xsl:attribute>
  127. </xsl:when>
  128. <xsl:otherwise>
  129. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/></xsl:attribute>
  130. </xsl:otherwise>
  131. </xsl:choose>
  132. </xsl:when>
  133. </xsl:choose>
  134. <xsl:if test="@tooltip">
  135. <xsl:attribute name="title"><xsl:value-of select="@tooltip"/></xsl:attribute>
  136. </xsl:if>
  137. <xsl:if test="$strict='false'">
  138. <xsl:copy-of select="HA/@*"/>
  139. <xsl:if test="$appSupport='false'">
  140. <xsl:for-each select="@name">
  141. <xsl:attribute name="LID"><xsl:value-of select="."/><xsl:value-of select="$namespaceId"/></xsl:attribute>
  142. </xsl:for-each>
  143. </xsl:if>
  144. </xsl:if>
  145. <xsl:if test="@blkTblTxtAlign and $strict='false' and $appSupport='true'">
  146. <xsl:attribute name="blkTblAgn">
  147. <xsl:value-of select="@blkTblTxtAlign"/>
  148. </xsl:attribute>
  149. </xsl:if>
  150. <xsl:if test="@actualDisplay">
  151. <xsl:attribute name="actualDisplay"><xsl:value-of select="@actualDisplay"/></xsl:attribute>
  152. </xsl:if>
  153. <xsl:if test="@dts">
  154. <xsl:attribute name="dts"><xsl:value-of select ="@dts"/></xsl:attribute>
  155. </xsl:if>
  156. </xsl:template>
  157. <xsl:template name="GenRTAttributes">
  158. <xsl:choose>
  159. <xsl:when test="@style">
  160. <!-- Add cursor to style if bookmarkRef defined -->
  161. <xsl:attribute name="style"><xsl:for-each select="@style"><xsl:value-of select="."/>;</xsl:for-each><!-- Use pointer and hand (in that order) to get NS and IE working --><xsl:if test="@bookmarkRef">cursor:pointer;cursor:hand;</xsl:if></xsl:attribute>
  162. </xsl:when>
  163. <xsl:otherwise>
  164. <!-- no style, check for bookmarkRef. This avoids generating two style attributes -->
  165. <xsl:if test="@bookmarkRef">
  166. <xsl:attribute name="style">cursor:pointer;cursor:hand;</xsl:attribute>
  167. </xsl:if>
  168. </xsl:otherwise>
  169. </xsl:choose>
  170. <xsl:if test="@bookmarkRef">
  171. <xsl:variable name="location">
  172. <xsl:text>'</xsl:text>
  173. <xsl:value-of select="rsext:javascriptencode(rsext:replace(rsext:urlencode(string(@bookmarkRef)), '+', '-'))"/>
  174. <xsl:text>'</xsl:text>
  175. <xsl:if test="@bookmarkPage">
  176. <xsl:text>, '</xsl:text>
  177. <xsl:value-of select="@bookmarkPage"/>
  178. <xsl:text>', oCV</xsl:text>
  179. <xsl:value-of select="$viewerID"/>
  180. </xsl:if>
  181. </xsl:variable>
  182. <xsl:choose>
  183. <xsl:when test="$strict='true'">
  184. <xsl:attribute name="onclick">docLocation(<xsl:value-of select="$location"/>);</xsl:attribute>
  185. <xsl:attribute name="onkeypress">if (event.keyCode == 13) {docLocation(<xsl:value-of select="$location"/>);}</xsl:attribute>
  186. </xsl:when>
  187. <xsl:otherwise>
  188. <xsl:attribute name="onClick">docLocation(<xsl:value-of select="$location"/>);</xsl:attribute>
  189. <xsl:attribute name="onKeyPress">if (event.keyCode == 13) {docLocation(<xsl:value-of select="$location"/>);}</xsl:attribute>
  190. <xsl:attribute name="tabIndex">0</xsl:attribute>
  191. <xsl:if test="$accessible='true'">
  192. <xsl:attribute name="role">link</xsl:attribute>
  193. </xsl:if>
  194. </xsl:otherwise>
  195. </xsl:choose>
  196. </xsl:if>
  197. <xsl:copy-of select="@class"/>
  198. <xsl:if test="@styleId">
  199. <xsl:choose>
  200. <xsl:when test="$vUseStyleId='true'">
  201. <xsl:attribute name="class"><xsl:value-of select="@styleId"/></xsl:attribute>
  202. </xsl:when>
  203. <xsl:otherwise>
  204. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/></xsl:attribute>
  205. </xsl:otherwise>
  206. </xsl:choose>
  207. </xsl:if>
  208. <xsl:if test="@tooltip">
  209. <xsl:attribute name="title"><xsl:value-of select="@tooltip" /></xsl:attribute>
  210. </xsl:if>
  211. </xsl:template>
  212. <xsl:template name="GenTDAttributes">
  213. <xsl:call-template name="GenCommonAttributes"/>
  214. <xsl:copy-of select="@colspan" />
  215. <xsl:copy-of select="@rowspan" />
  216. <xsl:if test="$strict='true' or $accessible='true'"> <!-- Accessibility only -->
  217. <xsl:if test="@id">
  218. <xsl:attribute name="id">
  219. <xsl:choose>
  220. <xsl:when test="starts-with(@id, 'hdr')"><xsl:value-of select="concat($viewerID, @id)"/></xsl:when>
  221. <xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>
  222. </xsl:choose>
  223. </xsl:attribute>
  224. </xsl:if>
  225. <xsl:if test="@headers">
  226. <xsl:attribute name="headers"><xsl:value-of select='rsext:replace(@headers, "hdr", concat($viewerID, "hdr"))'/></xsl:attribute>
  227. </xsl:if>
  228. <xsl:copy-of select="@axis" />
  229. <xsl:if test="@layoutClass='crosstabNodeMember' and $strict='false'">
  230. <xsl:choose>
  231. <xsl:when test="../@isTopLabel">
  232. <xsl:attribute name="role">columnheader</xsl:attribute>
  233. </xsl:when>
  234. <xsl:otherwise>
  235. <xsl:attribute name="role">rowheader</xsl:attribute>
  236. </xsl:otherwise>
  237. </xsl:choose>
  238. </xsl:if>
  239. </xsl:if>
  240. <!-- TCB <xsl:if test="@hspan">
  241. <xsl:attribute name="colspan"><xsl:value-of select="@hspan" /></xsl:attribute>
  242. </xsl:if>
  243. <xsl:if test="@vspan">
  244. <xsl:attribute name="rowspan"><xsl:value-of select="@vspan" /></xsl:attribute>
  245. </xsl:if> -->
  246. </xsl:template>
  247. <xsl:template name="GenTDChildElements">
  248. <xsl:if test="$accessible='true' and @layoutClass='rowCell'">
  249. <xsl:variable name="uniqueId"><xsl:value-of select="concat($viewerID, generate-id(.), 'hiddenspan', $pageNumber)"/></xsl:variable>
  250. <xsl:choose>
  251. <xsl:when test="@type='section'"> <!--header row-->
  252. <span>
  253. <xsl:attribute name="style">display: none;</xsl:attribute>
  254. <xsl:attribute name="id"><xsl:value-of select="$uniqueId"/></xsl:attribute>
  255. <xsl:value-of select="$headerLabelText" disable-output-escaping="yes"/>
  256. </span>
  257. </xsl:when>
  258. <xsl:when test="@type='summary'"> <!--footer row-->
  259. <span>
  260. <xsl:attribute name="style">display: none;</xsl:attribute>
  261. <xsl:attribute name="id"><xsl:value-of select="$uniqueId"/></xsl:attribute>
  262. <xsl:value-of select="$footerLabelText" disable-output-escaping="yes"/>
  263. </span>
  264. </xsl:when>
  265. </xsl:choose>
  266. </xsl:if>
  267. <xsl:choose>
  268. <xsl:when test="not(*)">
  269. <xsl:if test="@layoutClass='crosstabCorner' and $strict = 'false' and $appSupport='false'">
  270. <!-- if the crosstab corner has no children, add a tab stop -->
  271. <span tabIndex="0">
  272. <xsl:if test="$accessible='true'">
  273. <xsl:attribute name="role">gridcell</xsl:attribute>
  274. <xsl:attribute name="aria-label"><xsl:value-of select="$emptyCellLabelText"/></xsl:attribute>
  275. </xsl:if>
  276. </span>
  277. </xsl:if>
  278. <xsl:choose>
  279. <xsl:when test="$vUseStyleId='true'">
  280. <xsl:variable name="sStyleIdValue1" select="key('getOptStyle',@styleId)/@value"/>
  281. <xsl:variable name="sStyleIdValue2" select="key('getOptStyle',../../@styleId)/@value"/>
  282. <xsl:if test="contains($sStyleIdValue1,'empty-cells:show') or contains($sStyleIdValue2,'empty-cells:show')">
  283. <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
  284. </xsl:if>
  285. </xsl:when>
  286. <xsl:otherwise>
  287. <xsl:if test="contains(@style,'empty-cells:show') or contains(../../@style,'empty-cells:show')">
  288. <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
  289. </xsl:if>
  290. </xsl:otherwise>
  291. </xsl:choose>
  292. </xsl:when>
  293. <xsl:otherwise>
  294. <xsl:apply-templates select="*"/>
  295. </xsl:otherwise>
  296. </xsl:choose>
  297. </xsl:template>
  298. <xsl:template name="GenCommonTableAttributes">
  299. <xsl:call-template name="GenCommonAttributes"/>
  300. <xsl:attribute name="cellpadding"><xsl:text>0</xsl:text></xsl:attribute>
  301. <xsl:choose>
  302. <xsl:when test="not(@styleId) and @style">
  303. <xsl:if test="contains(@style, 'border-spacing:') and $strict='false'">
  304. <xsl:attribute name="cellspacing"><xsl:variable name="sBorderSpacing" select="substring-after(@style, 'border-spacing:')"/><xsl:choose><xsl:when test="substring-before($sBorderSpacing, ';')"><xsl:value-of select="substring-before($sBorderSpacing, ';')" /></xsl:when><xsl:when test="$sBorderSpacing"><xsl:value-of select="$sBorderSpacing" /></xsl:when><xsl:otherwise><xsl:text >0</xsl:text></xsl:otherwise></xsl:choose></xsl:attribute>
  305. </xsl:if>
  306. </xsl:when>
  307. <xsl:when test="not(@style) and @styleId">
  308. <xsl:variable name="sStyleIdValue" select="key('getOptStyle',@styleId)/@value"/>
  309. <xsl:if test="contains($sStyleIdValue, 'border-spacing:') and $strict='false'">
  310. <xsl:attribute name="cellspacing"><xsl:variable name="sBorderSpacing" select="substring-after($sStyleIdValue, 'border-spacing:')"/><xsl:choose><xsl:when test="substring-before($sBorderSpacing, ';')"><xsl:value-of select="substring-before($sBorderSpacing, ';')"/></xsl:when><xsl:when test="$sBorderSpacing"><xsl:value-of select="$sBorderSpacing"/></xsl:when><xsl:otherwise><xsl:text>0</xsl:text></xsl:otherwise></xsl:choose></xsl:attribute>
  311. </xsl:if>
  312. </xsl:when>
  313. </xsl:choose>
  314. <xsl:if test="$accessible='true'">
  315. <xsl:choose>
  316. <xsl:when test="@isLayoutTable">
  317. <xsl:attribute name="role">presentation</xsl:attribute>
  318. </xsl:when>
  319. <xsl:otherwise>
  320. <xsl:attribute name="role">grid</xsl:attribute>
  321. <xsl:if test="@summaryText"> <!-- label the table with the summary text for now -->
  322. <xsl:attribute name="aria-label"><xsl:value-of select="@summaryText" /></xsl:attribute>
  323. </xsl:if>
  324. </xsl:otherwise>
  325. </xsl:choose>
  326. <xsl:if test="@summaryText">
  327. <xsl:attribute name="summary"><xsl:value-of select="@summaryText" /></xsl:attribute>
  328. </xsl:if>
  329. </xsl:if>
  330. <xsl:if test="@blkTblTxtAlign and $strict='false'">
  331. <xsl:attribute name="blkTblAgn"><xsl:value-of select="@blkTblTxtAlign"/></xsl:attribute>
  332. </xsl:if>
  333. <xsl:if test="@dir and $strict='false'">
  334. <xsl:attribute name="dir">
  335. <xsl:value-of select="@dir"/>
  336. </xsl:attribute>
  337. </xsl:if>
  338. </xsl:template>
  339. <xsl:template match="styleOptions">
  340. <xsl:if test="$appSupport='false'">
  341. <xsl:choose>
  342. <xsl:when test="$email='true'">
  343. <xsl:for-each select="cssText">
  344. <style type="text/css">
  345. <xsl:value-of select="."/>
  346. </style>
  347. </xsl:for-each>
  348. </xsl:when>
  349. <xsl:when test="cssOptStyles">
  350. <xsl:for-each select="cssUrl">
  351. <link rel="stylesheet" type="text/css">
  352. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  353. </link>
  354. </xsl:for-each>
  355. <style type="text/css"><xsl:value-of select="cssOptStyles" disable-output-escaping="yes"/></style>
  356. </xsl:when>
  357. <xsl:otherwise>
  358. <xsl:for-each select="cssUrl">
  359. <link rel="stylesheet" type="text/css">
  360. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  361. </link>
  362. </xsl:for-each>
  363. </xsl:otherwise>
  364. </xsl:choose>
  365. <xsl:if test="namedCssStyleText">
  366. <style type="text/css">
  367. <xsl:value-of select="namedCssStyleText" disable-output-escaping="yes"/>
  368. </style>
  369. </xsl:if>
  370. </xsl:if>
  371. </xsl:template>
  372. <!-- Generate a background image in case we are saving the report -->
  373. <xsl:template name="GenBackgroundImage">
  374. <xsl:if test="(@bgsrcsave or @bgsrcsaveAs) and ($chartSrc='srcsave' or $chartSrc='srcsaveAs')">
  375. <xsl:variable name="sBackgroundName">
  376. <xsl:value-of select='concat ("i", $pageNumber, rsext:replace(string(generate-id(.)), ".", "_"))' />
  377. </xsl:variable>
  378. <script>
  379. <xsl:if test="$strict='false'">
  380. <xsl:attribute name="language">javascript</xsl:attribute>
  381. </xsl:if>
  382. <xsl:attribute name="type">text/javascript</xsl:attribute>
  383. <xsl:attribute name="id"><xsl:value-of select="$sBackgroundName" /></xsl:attribute>
  384. <xsl:if test="$Xhtml='true'">
  385. <xsl:text disable-output-escaping="yes">
  386. //&lt;![CDATA[
  387. </xsl:text>
  388. </xsl:if>
  389. <!--
  390. Create the uri that points to the saved output chart in content manager.
  391. The variables are defined in html.xsl
  392. -->
  393. <xsl:variable name="sGraphicName">
  394. <xsl:choose>
  395. <xsl:when test="$chartSrc='srcsaveAs'">
  396. <xsl:value-of select="@bgsrcsaveAs"/>
  397. </xsl:when>
  398. <xsl:otherwise>
  399. <xsl:value-of select="@bgsrcsave"/>
  400. </xsl:otherwise>
  401. </xsl:choose>
  402. </xsl:variable>
  403. displayBackground("<xsl:value-of select='$sBackgroundName'/>", "<xsl:value-of select="rsext:javascriptencode(string($sGraphicName))"/>",
  404. <xsl:choose>
  405. <xsl:when test="$testMode = 'true'">true</xsl:when>
  406. <xsl:otherwise>false</xsl:otherwise>
  407. </xsl:choose>);
  408. <xsl:if test="$Xhtml='true'">
  409. <xsl:text disable-output-escaping="yes">
  410. //]]&gt;
  411. </xsl:text>
  412. </xsl:if>
  413. </script>
  414. </xsl:if>
  415. </xsl:template>
  416. <xsl:template name="GenChartImageContainer">
  417. <xsl:variable name="uniqueId"><xsl:value-of select="concat($CognosViewerID, generate-id(.), $pageNumber)"/></xsl:variable>
  418. <xsl:variable name="tag">
  419. <xsl:choose>
  420. <xsl:when test="@layoutClass='viz'">div</xsl:when>
  421. <xsl:otherwise>span</xsl:otherwise>
  422. </xsl:choose>
  423. </xsl:variable>
  424. <xsl:element name="{$tag}">
  425. <xsl:if test="$strict ='false'">
  426. <xsl:attribute name="tabIndex">0</xsl:attribute>
  427. </xsl:if>
  428. <xsl:if test="$accessible='true'">
  429. <xsl:attribute name="role">img</xsl:attribute>
  430. <xsl:attribute name="aria-labelledby"><xsl:value-of select="$uniqueId"/></xsl:attribute>
  431. <span style="visibility:hidden; display:none" id="{$uniqueId}"><xsl:value-of select="@altText"/></span>
  432. </xsl:if>
  433. <xsl:call-template name="GenChartImage"/>
  434. </xsl:element>
  435. </xsl:template>
  436. <!-- Generate a chart image As SVG -->
  437. <xsl:template name="SplitTooltip">
  438. <xsl:param name="sTooltip"/>
  439. <xsl:choose>
  440. <xsl:when test="contains($sTooltip,$sDelimiter)">
  441. <xsl:value-of select="substring-before($sTooltip,$sDelimiter)"/><br/><xsl:value-of disable-output-escaping="yes" select ="$sDelimiter"/>
  442. <xsl:call-template name="SplitTooltip">
  443. <xsl:with-param name="sTooltip" select="substring-after($sTooltip,$sDelimiter)"/>
  444. </xsl:call-template>
  445. </xsl:when>
  446. <xsl:otherwise>
  447. <xsl:value-of select="$sTooltip"/>
  448. </xsl:otherwise>
  449. </xsl:choose>
  450. </xsl:template>
  451. <xsl:template name="GenChartMapAsSvg">
  452. <xsl:choose>
  453. <xsl:when test="./REVERSE and $chartUsesSvg='true'">
  454. <xsl:for-each select="./REVERSE/*"><!-- OAREA -->
  455. <xsl:call-template name="GenChartAreaAsSvg"/>
  456. </xsl:for-each>
  457. </xsl:when>
  458. <xsl:otherwise>
  459. <xsl:for-each select="./*"><!-- OAREA -->
  460. <xsl:call-template name="GenChartAreaAsSvg"/>
  461. </xsl:for-each>
  462. </xsl:otherwise>
  463. </xsl:choose>
  464. </xsl:template>
  465. <xsl:template name="GenChartAreaAsSvg">
  466. <xsl:if test="@layoutClass='chart_area'">
  467. <xsl:variable name="sStartCoord">
  468. <xsl:value-of select="substring-before(@coords,',')"/>
  469. <xsl:text>,</xsl:text>
  470. <xsl:choose>
  471. <xsl:when test="contains(substring-after(@coords,','),',')">
  472. <xsl:value-of select="substring-before(substring-after(@coords,','),',')"/>
  473. </xsl:when>
  474. <xsl:otherwise>
  475. <xsl:value-of select="substring-after(@coords,',')"/>
  476. </xsl:otherwise>
  477. </xsl:choose>
  478. </xsl:variable>
  479. <polyline>
  480. <xsl:attribute name="points"><xsl:value-of select="@coords"/><xsl:text> </xsl:text><xsl:value-of select="$sStartCoord"/></xsl:attribute>
  481. <xsl:if test="@roid">
  482. <xsl:attribute name="roid"><xsl:value-of select="@roid"/></xsl:attribute>
  483. </xsl:if>
  484. <xsl:if test="@ctx">
  485. <xsl:attribute name="ctx"><xsl:value-of select="@ctx"/></xsl:attribute>
  486. </xsl:if>
  487. <xsl:if test="@specname">
  488. <xsl:attribute name="specname"><xsl:value-of select="@specname"/></xsl:attribute>
  489. </xsl:if>
  490. <xsl:if test="MEASURE and MEASURE != '' ">
  491. <xsl:attribute name="display">
  492. <xsl:value-of select="rsext:htmlencode(string(./MEASURE))" disable-output-escaping="yes"/>
  493. </xsl:attribute>
  494. </xsl:if>
  495. <xsl:if test="./drillTargets">
  496. <xsl:apply-templates select="." />
  497. </xsl:if>
  498. <xsl:if test="@title">
  499. <title>
  500. <xsl:choose>
  501. <xsl:when test="contains(@title,$sDelimiter)">
  502. <xsl:call-template name="SplitTooltip">
  503. <xsl:with-param name="sTooltip" select="@title"/>
  504. </xsl:call-template>
  505. </xsl:when>
  506. <xsl:otherwise>
  507. <xsl:value-of select="@title"/>
  508. </xsl:otherwise>
  509. </xsl:choose>
  510. </title>
  511. </xsl:if>
  512. </polyline>
  513. </xsl:if>
  514. </xsl:template>
  515. <xsl:template name="GenChartImageAsSvg">
  516. <xsl:variable name="sSvgStyle">
  517. <xsl:if test="@chart_height">
  518. <xsl:text>height:</xsl:text><xsl:value-of select="@chart_height"/><xsl:text>px;</xsl:text>
  519. </xsl:if>
  520. <xsl:if test="@chart_width">
  521. <xsl:text>width:</xsl:text><xsl:value-of select="@chart_width"/><xsl:text>px;</xsl:text>
  522. </xsl:if>
  523. <xsl:if test="$chartSrc = 'src'">
  524. <xsl:text>background-image:url(</xsl:text>
  525. <xsl:choose>
  526. <xsl:when test="starts-with(@src, '?b_action')">
  527. <xsl:value-of select="$CVGateway"/><xsl:value-of select="@src"/>
  528. </xsl:when>
  529. <xsl:otherwise>
  530. <xsl:value-of select="@src"/>
  531. </xsl:otherwise>
  532. </xsl:choose>
  533. <xsl:text>);</xsl:text>
  534. </xsl:if>
  535. </xsl:variable>
  536. <xsl:variable name="sUsemap" select="@usemap"/>
  537. <svg>
  538. <xsl:copy-of select="@name"/>
  539. <xsl:attribute name="viewBox">0 0 <xsl:value-of select="@chart_width"/><xsl:text> </xsl:text><xsl:value-of select="@chart_height" /></xsl:attribute>
  540. <xsl:if test="@style">
  541. <xsl:attribute name="style"><xsl:for-each select="@style"><xsl:value-of select="."/>;</xsl:for-each><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  542. </xsl:if>
  543. <xsl:if test="$chartSrc = 'srcsave'">
  544. <xsl:attribute name="graphic"><xsl:value-of select="@srcsave"/></xsl:attribute>
  545. </xsl:if>
  546. <xsl:if test="$chartSrc = 'srcsaveAs'">
  547. <xsl:attribute name="graphic"><xsl:value-of select="@srcsaveAs"/></xsl:attribute>
  548. </xsl:if>
  549. <xsl:choose>
  550. <xsl:when test="not(@class) and @styleId and @layoutClass">
  551. <xsl:choose>
  552. <xsl:when test="$vUseStyleId='true'">
  553. <xsl:if test="string-length($sSvgStyle) != 0">
  554. <xsl:attribute name="style"><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  555. </xsl:if>
  556. <xsl:attribute name="class"><xsl:value-of select="@styleId"/><xsl:text> clsSvgImageMap</xsl:text></xsl:attribute>
  557. </xsl:when>
  558. <xsl:otherwise>
  559. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  560. <xsl:attribute name="class"><xsl:text>clsSvgImageMap</xsl:text></xsl:attribute>
  561. </xsl:otherwise>
  562. </xsl:choose>
  563. </xsl:when>
  564. <xsl:when test="not(@class) and not(@styleId) and @layoutClass">
  565. <xsl:if test="string-length($sSvgStyle) != 0">
  566. <xsl:attribute name="style"><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  567. </xsl:if>
  568. <xsl:attribute name="class"><xsl:text>clsSvgImageMap</xsl:text></xsl:attribute>
  569. </xsl:when>
  570. <xsl:when test="@styleId and @class">
  571. <xsl:choose>
  572. <xsl:when test="$vUseStyleId='true'">
  573. <xsl:if test="string-length($sSvgStyle) != 0">
  574. <xsl:attribute name="style"><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  575. </xsl:if>
  576. <xsl:attribute name="class"><xsl:value-of select="@class"/><xsl:text> </xsl:text><xsl:value-of select="@styleId"/><xsl:text> clsSvgImageMap</xsl:text></xsl:attribute>
  577. </xsl:when>
  578. <xsl:otherwise>
  579. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  580. <xsl:attribute name="class"><xsl:value-of select="@class"/><xsl:text> clsSvgImageMap</xsl:text></xsl:attribute>
  581. </xsl:otherwise>
  582. </xsl:choose>
  583. </xsl:when>
  584. <xsl:when test="not(@styleId) and @class">
  585. <xsl:if test="string-length($sSvgStyle) != 0">
  586. <xsl:attribute name="style"><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  587. </xsl:if>
  588. <xsl:attribute name="class"><xsl:value-of select="@class"/><xsl:text> clsSvgImageMap</xsl:text></xsl:attribute>
  589. </xsl:when>
  590. <xsl:when test="not(@class) and not(@layoutClass) and @styleId">
  591. <xsl:choose>
  592. <xsl:when test="$vUseStyleId='true'">
  593. <xsl:if test="string-length($sSvgStyle) != 0">
  594. <xsl:attribute name="style"><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  595. </xsl:if>
  596. <xsl:attribute name="class"><xsl:value-of select="@styleId"/><xsl:text> clsSvgImageMap</xsl:text></xsl:attribute>
  597. </xsl:when>
  598. <xsl:otherwise>
  599. <xsl:attribute name="style"><xsl:value-of select="key('getOptStyle',@styleId)/@value"/><xsl:value-of select="$sSvgStyle"/></xsl:attribute>
  600. </xsl:otherwise>
  601. </xsl:choose>
  602. </xsl:when>
  603. </xsl:choose>
  604. <xsl:if test="$strict='false'">
  605. <xsl:copy-of select="HA/@*"/>
  606. </xsl:if>
  607. <xsl:variable name="uniqueId">
  608. <xsl:choose>
  609. <xsl:when test="$testMode = 'true'"><xsl:value-of select="'uniqueId'"/></xsl:when>
  610. <xsl:otherwise><xsl:value-of select="generate-id(.)"/></xsl:otherwise>
  611. </xsl:choose>
  612. </xsl:variable>
  613. <xsl:if test="$accessible='true'">
  614. <xsl:attribute name="role">img</xsl:attribute>
  615. <xsl:attribute name="aria-labelledby"><xsl:value-of select="$uniqueId"/></xsl:attribute>
  616. <title><xsl:attribute name="id"><xsl:value-of select="$uniqueId"/></xsl:attribute><xsl:value-of select="@altText"/></title>
  617. </xsl:if>
  618. <xsl:for-each select="../OMAP[@name=$sUsemap]|parent::WRAP/../OMAP[@name=$sUsemap]">
  619. <xsl:call-template name="GenChartMapAsSvg"/>
  620. </xsl:for-each>
  621. </svg>
  622. </xsl:template>
  623. <!-- Generate a chart image -->
  624. <xsl:template name="GenChartImage">
  625. <img>
  626. <xsl:if test="$appSupport='false'">
  627. <xsl:choose>
  628. <xsl:when test="$strict='true'">
  629. <xsl:attribute name="id">chart<xsl:value-of select='concat ($pageNumber, "_", rsext:replace(string(generate-id(.)), ".", "_"))'/></xsl:attribute>
  630. </xsl:when>
  631. <xsl:otherwise>
  632. <xsl:attribute name="name">chart<xsl:value-of select='concat ($pageNumber, "_", rsext:replace(string(generate-id(.)), ".", "_"))'/></xsl:attribute>
  633. </xsl:otherwise>
  634. </xsl:choose>
  635. </xsl:if>
  636. <xsl:call-template name="GenCommonAttributes"/>
  637. <xsl:call-template name="GenEventHandlers"/>
  638. <xsl:choose>
  639. <xsl:when test="$chartSrc = 'src'">
  640. <xsl:attribute name="src">
  641. <xsl:choose>
  642. <xsl:when test="starts-with(@src, '?b_action')">
  643. <xsl:value-of select="$CVGateway"/><xsl:value-of select="@src"/>
  644. </xsl:when>
  645. <xsl:when test="starts-with(@src, '/repository')">
  646. <xsl:text/>/<xsl:value-of select="substring-after(substring-after($gatewayPath, '//'),'/')"/><xsl:value-of select="@src"/>
  647. </xsl:when>
  648. <xsl:otherwise>
  649. <xsl:value-of select="@src"/>
  650. </xsl:otherwise>
  651. </xsl:choose>
  652. </xsl:attribute>
  653. </xsl:when>
  654. <xsl:when test="$chartSrc = 'srcemail'">
  655. <xsl:attribute name="src"><xsl:value-of select="@srcemail" /></xsl:attribute>
  656. </xsl:when>
  657. <xsl:when test="$chartSrc = 'srcmobile'">
  658. <xsl:attribute name="src"><xsl:value-of select="@srcmobile" /></xsl:attribute>
  659. </xsl:when>
  660. <xsl:otherwise>
  661. <xsl:if test="$strict='true'">
  662. <xsl:attribute name="src">graphic</xsl:attribute>
  663. </xsl:if>
  664. </xsl:otherwise>
  665. </xsl:choose>
  666. <xsl:if test="@chart_width">
  667. <xsl:attribute name="width"><xsl:value-of select="@chart_width" /></xsl:attribute>
  668. </xsl:if>
  669. <xsl:if test="@chart_height">
  670. <xsl:attribute name="height"><xsl:value-of select="@chart_height" /></xsl:attribute>
  671. </xsl:if>
  672. <xsl:if test="@usemap">
  673. <xsl:attribute name="usemap">#<xsl:value-of select="$namespaceId"/><xsl:value-of select="@usemap" /></xsl:attribute>
  674. <xsl:if test="$strict='false'">
  675. <xsl:attribute name="border">0</xsl:attribute>
  676. </xsl:if>
  677. </xsl:if>
  678. <xsl:choose>
  679. <xsl:when test="$accessible='true'">
  680. <xsl:attribute name="alt"><xsl:value-of select="@altText" /></xsl:attribute>
  681. <xsl:attribute name="role">presentation</xsl:attribute>
  682. </xsl:when>
  683. <xsl:when test="$strict='true'">
  684. <xsl:attribute name="alt"><xsl:value-of select="@name" /></xsl:attribute>
  685. </xsl:when>
  686. </xsl:choose>
  687. </img>
  688. <xsl:variable name="sUseScale">
  689. <xsl:choose>
  690. <xsl:when test='contains(@chart_width, "%") or contains(@chart_height, "%")'>true</xsl:when>
  691. <xsl:otherwise>false</xsl:otherwise>
  692. </xsl:choose>
  693. </xsl:variable>
  694. <xsl:variable name="sIsImage">
  695. <xsl:choose>
  696. <xsl:when test="@layoutClass='image' or @layoutClass='richTextImage' or @layoutClass='CMMMap'">true</xsl:when>
  697. <xsl:otherwise>false</xsl:otherwise>
  698. </xsl:choose>
  699. </xsl:variable>
  700. <xsl:if test="$email = 'false' and $appSupport='false'">
  701. <script>
  702. <xsl:if test="$strict='false'">
  703. <xsl:attribute name="language">javascript</xsl:attribute>
  704. </xsl:if>
  705. <xsl:attribute name="type">text/javascript</xsl:attribute>
  706. <xsl:if test="$Xhtml='true' and $isNewViewer='false'">
  707. <xsl:text disable-output-escaping="yes">
  708. //&lt;![CDATA[
  709. </xsl:text>
  710. </xsl:if>
  711. <xsl:if test="$isNewViewer='false'">
  712. <xsl:choose>
  713. <xsl:when test="$chartSrc='srcsave' or $chartSrc='srcsaveAs'">
  714. <!--
  715. Create the uri that points to the saved output chart in content manager.
  716. The variables are defined in html.xsl
  717. -->
  718. <xsl:variable name="sGraphicName">
  719. <xsl:choose>
  720. <xsl:when test="@srcsaveAs !=''">
  721. <xsl:value-of select="@srcsaveAs"/>
  722. </xsl:when>
  723. <xsl:otherwise>
  724. <xsl:value-of select="@srcsave"/>
  725. </xsl:otherwise>
  726. </xsl:choose>
  727. </xsl:variable>
  728. <xsl:variable name="sChartName">
  729. <xsl:value-of select='concat ($pageNumber, "_", rsext:replace(string(generate-id(.)), ".", "_"))'/>
  730. </xsl:variable>
  731. var graphicName<xsl:value-of select='$sChartName'/> = "<xsl:value-of select="rsext:javascriptencode(string($sGraphicName))"/>";
  732. var graphicSrc<xsl:value-of select='$sChartName'/> = resolveGraphicSrc (graphicName<xsl:value-of select='$sChartName'/>, false);
  733. <xsl:if test="$testMode = 'true'">
  734. graphicSrc<xsl:value-of select='$sChartName'/> = graphicName<xsl:value-of select='$sChartName'/>;
  735. </xsl:if>
  736. displayChart("chart<xsl:value-of select="$sChartName"/>", graphicSrc<xsl:value-of select='$sChartName'/>, <xsl:value-of select="$sUseScale"/>, <xsl:value-of select="$sIsImage"/>);
  737. </xsl:when>
  738. <xsl:otherwise>
  739. <xsl:variable name="sChartName">
  740. <xsl:value-of select='concat ($pageNumber, "_", rsext:replace(string(generate-id(.)), ".", "_"))'/>
  741. </xsl:variable>
  742. var graphicSrc<xsl:value-of select='$sChartName'/> = document.images["chart<xsl:value-of select='$sChartName'/>"].src;
  743. displayChart("chart<xsl:value-of select='$sChartName'/>", "", <xsl:value-of select="$sUseScale"/>, <xsl:value-of select="$sIsImage"/>);
  744. </xsl:otherwise>
  745. </xsl:choose>
  746. </xsl:if>
  747. <xsl:if test="$Xhtml='true' and $isNewViewer='false'">
  748. <xsl:text disable-output-escaping="yes">
  749. //]]&gt;
  750. </xsl:text>
  751. </xsl:if>
  752. </script>
  753. </xsl:if>
  754. </xsl:template>
  755. <!--
  756. The "mother of all templates".
  757. It is faster to check @layoutClass procedurally than to specify the the @layoutClass= in the match clause.
  758. -->
  759. <xsl:template match="*[@layoutClass]" name="GenReportLayout">
  760. <xsl:choose>
  761. <!--
  762. **************************************************
  763. THIS SECTION SHOULD BE REMOVED.
  764. THESE ELEMENTS TO NOT EXIST IN THE LAYOUT SPEC
  765. BUT THEY ARE STILL BE GENERATED IN THE XML AS IF THEY DO
  766. crosstabInnerHeaderCell
  767. crosstabInnerFooterCell
  768. crosstabOuterHeaderCell
  769. crosstabOuterFooterCell
  770. <xsl:when test="@layoutClass='crosstabInnerHeaderCell' or @layoutClass='crosstabInnerFooterCell' or @layoutClass='crosstabOuterHeaderCell' or @layoutClass='crosstabOuterFooterCell'">
  771. <td>
  772. <xsl:call-template name="GenTDAttributes"/>
  773. <xsl:call-template name="GenEventHandlers"/>
  774. <xsl:call-template name="GenBackgroundImage"/>
  775. <xsl:call-template name="GenTDChildElements"/>
  776. </td>
  777. </xsl:when>
  778. -->
  779. <!--
  780. listColumnTitle
  781. listColumn
  782. rowCell
  783. These elements may inherit styles from their parents. This is the incorrect place to do this.
  784. This should have been accounted for in the generated XML because the related elements may
  785. not all be contained in the same row.
  786. -->
  787. <xsl:when test="@layoutClass='listColumnTitle' or @layoutClass='listColumnBody' or @layoutClass='rowCell'">
  788. <xsl:choose>
  789. <xsl:when test="( $strict='true' or $accessible='true' ) and (@layoutClass='listColumnTitle' or @layoutClass='crosstabLevel' or @layoutClass='levelHeader' or (@layoutClass='rowCell' and @type='section') or (@layoutClass='listColumnBody' and @tblHdr))">
  790. <th>
  791. <xsl:call-template name="GenTDAttributes"/>
  792. <!-- overwrite style with parent and self style -->
  793. <!-- TCB <xsl:if test="@style | ../@style">
  794. <xsl:attribute name="style"><xsl:if test="../@style"><xsl:value-of select="../@style" /></xsl:if><xsl:if test="@style">;<xsl:value-of select="@style" /></xsl:if></xsl:attribute>
  795. </xsl:if> -->
  796. <xsl:if test="@style">
  797. <xsl:variable name="sBackgroundImage">
  798. <xsl:if test="@bgsrc or @bgsrcemail">
  799. <xsl:choose>
  800. <xsl:when test="$chartSrc = 'src'">
  801. <xsl:text disable-output-escaping="yes">;background-image:url("</xsl:text>
  802. <xsl:choose>
  803. <xsl:when test="starts-with(@bgsrc, '?b_action')">
  804. <xsl:value-of select="$CVGateway"/><xsl:value-of select="@bgsrc"/>
  805. </xsl:when>
  806. <xsl:otherwise>
  807. <xsl:value-of select="@bgsrc"/>
  808. </xsl:otherwise>
  809. </xsl:choose>
  810. <xsl:text disable-output-escaping="yes">")</xsl:text>
  811. </xsl:when>
  812. <xsl:when test="$chartSrc = 'srcemail'">
  813. <xsl:text disable-output-escaping="yes">;background-image:url(</xsl:text>
  814. <xsl:value-of select="@bgsrcemail" disable-output-escaping="yes"/>
  815. <xsl:text disable-output-escaping="yes">)</xsl:text>
  816. </xsl:when>
  817. </xsl:choose>
  818. </xsl:if>
  819. </xsl:variable>
  820. <xsl:attribute name="style"><xsl:value-of select="@style" /><xsl:value-of select="$sBackgroundImage" /></xsl:attribute>
  821. </xsl:if>
  822. <xsl:call-template name="GenEventHandlers"/>
  823. <xsl:call-template name="GenTDChildElements"/>
  824. </th>
  825. </xsl:when>
  826. <xsl:otherwise>
  827. <td>
  828. <xsl:call-template name="GenTDAttributes"/>
  829. <!-- overwrite style with parent and self style -->
  830. <!-- TCB <xsl:if test="@style | ../@style">
  831. <xsl:attribute name="style"><xsl:if test="../@style"><xsl:value-of select="../@style" /></xsl:if><xsl:if test="@style">;<xsl:value-of select="@style" /></xsl:if></xsl:attribute>
  832. </xsl:if> -->
  833. <xsl:if test="@style">
  834. <xsl:variable name="sBackgroundImage">
  835. <xsl:if test="@bgsrc or @bgsrcemail">
  836. <xsl:choose>
  837. <xsl:when test="$chartSrc = 'src'">
  838. <xsl:text disable-output-escaping="yes">;background-image:url("</xsl:text>
  839. <xsl:choose>
  840. <xsl:when test="starts-with(@bgsrc, '?b_action')">
  841. <xsl:value-of select="$CVGateway"/><xsl:value-of select="@bgsrc"/>
  842. </xsl:when>
  843. <xsl:otherwise>
  844. <xsl:value-of select="@bgsrc"/>
  845. </xsl:otherwise>
  846. </xsl:choose>
  847. <xsl:text disable-output-escaping="yes">")</xsl:text>
  848. </xsl:when>
  849. <xsl:when test="$chartSrc = 'srcemail'">
  850. <xsl:text disable-output-escaping="yes">;background-image:url(</xsl:text>
  851. <xsl:value-of select="@bgsrcemail" disable-output-escaping="yes"/>
  852. <xsl:text disable-output-escaping="yes">)</xsl:text>
  853. </xsl:when>
  854. </xsl:choose>
  855. </xsl:if>
  856. </xsl:variable>
  857. <xsl:attribute name="style"><xsl:value-of select="@style" /><xsl:value-of select="$sBackgroundImage" /></xsl:attribute>
  858. </xsl:if>
  859. <xsl:call-template name="GenEventHandlers"/>
  860. <xsl:call-template name="GenBackgroundImage"/>
  861. <xsl:call-template name="GenTDChildElements"/>
  862. </td>
  863. </xsl:otherwise>
  864. </xsl:choose>
  865. </xsl:when>
  866. <!--
  867. crosstabCorner
  868. crosstabCell
  869. crosstabFact
  870. crosstabFactCell
  871. crosstabNodeMember
  872. crosstabMember
  873. repeaterBody
  874. -->
  875. <xsl:when test="@layoutClass='crosstabCorner' or @layoutClass='crosstabCell' or @layoutClass='crosstabNodeMember' or @layoutClass='crosstabFactCell' or @layoutClass='crosstabFact' or @layoutClass='crosstabMember' or @layoutClass='repeaterBody'">
  876. <xsl:choose>
  877. <xsl:when test="( $strict = 'true' or $accessible = 'true' ) and (@layoutClass='crosstabNodeMember' or @layoutClass='crosstabCorner')">
  878. <xsl:variable name="cornerCelltag">
  879. <xsl:choose>
  880. <xsl:when test=" not(*) and @layoutClass='crosstabCorner' and $accessible = 'true' ">td</xsl:when>
  881. <xsl:otherwise>th</xsl:otherwise>
  882. </xsl:choose>
  883. </xsl:variable>
  884. <xsl:element name="{$cornerCelltag}">
  885. <xsl:call-template name="GenTDAttributes"/>
  886. <xsl:call-template name="GenEventHandlers"/>
  887. <xsl:call-template name="GenBackgroundImage"/>
  888. <xsl:call-template name="GenTDChildElements"/>
  889. </xsl:element>
  890. </xsl:when>
  891. <xsl:otherwise>
  892. <td>
  893. <xsl:call-template name="GenTDAttributes"/>
  894. <xsl:call-template name="GenEventHandlers"/>
  895. <xsl:call-template name="GenBackgroundImage"/>
  896. <xsl:call-template name="GenTDChildElements"/>
  897. </td>
  898. </xsl:otherwise>
  899. </xsl:choose>
  900. </xsl:when>
  901. <!--
  902. listColumns
  903. listColumnTitles
  904. listRowCells
  905. crosstabRowLevels
  906. crosstabColumnLevels
  907. crosstabColumns
  908. crosstabRows
  909. There is no styling that should be applied to TRs. Any styling specified on these objects
  910. must be applied to their children. This really should be handled by the XML output generated,
  911. because TR may contain header cells and bodys cells (e.g. listColumn and rowCell elements).
  912. -->
  913. <xsl:when test="@layoutClass='listColumns' or @layoutClass='listColumnTitles' or @layoutClass='listRow' or @layoutClass='listRowCells' or @layoutClass='rowCells' or @layoutClass='crosstabColumnLevels' or @layoutClass='crosstabRowLevels' or @layoutClass='crosstabColumns' or @layoutClass='crosstabRows'">
  914. <tr>
  915. <xsl:if test="$accessible='true'">
  916. <xsl:attribute name="role">row</xsl:attribute>
  917. </xsl:if>
  918. <xsl:apply-templates select="*"/>
  919. <!-- the table has no measures -->
  920. <xsl:if test="@layoutClass='crosstabRows' and not(*[@layoutClass='crosstabFactCell']) and not(../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/*) and not(*[@layoutClass='crosstabCorner']) and (../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@rowspan &lt; 2 or ../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@rowspan='')">
  921. <xsl:choose>
  922. <!-- the condition meets when the layoutClass is crosstabRows which has colspan and vspan attributes or has vspan and no colspan attributes, ie the crosstabCorner has at least 2 rowspan and any number of colspan -->
  923. <xsl:when test="(../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@colspan!='' and ../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@rowspan='1') or (../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@colspan='' and ../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@rowspan!='')">
  924. <xsl:variable name="numColumn"><xsl:value-of select="../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/@colspan"/></xsl:variable>
  925. <xsl:variable name="numMultiple"><xsl:value-of select="count(../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/following-sibling::node())"/></xsl:variable>
  926. <td>
  927. <!-- get the total number of colspan -->
  928. <xsl:attribute name="colspan"><xsl:value-of select="$numColumn*$numMultiple"/></xsl:attribute>
  929. </td>
  930. </xsl:when>
  931. <!-- this condition exists when the crosstabCorner has 1 rowspan and any number of colspan -->
  932. <xsl:otherwise>
  933. <xsl:variable name="numColumns"><xsl:value-of select="count(../*[@layoutClass='crosstabRows']/*[@layoutClass='crosstabCorner']/following-sibling::node())"/></xsl:variable>
  934. <td>
  935. <!-- get the total number of colspan, don't count the crosstabCorner -->
  936. <xsl:attribute name="colspan"><xsl:value-of select="$numColumns"/></xsl:attribute>
  937. </td>
  938. </xsl:otherwise>
  939. </xsl:choose>
  940. </xsl:if>
  941. </tr>
  942. </xsl:when>
  943. <!--
  944. list
  945. crosstab
  946. -->
  947. <xsl:when test="@layoutClass='list' or @layoutClass='crosstab'">
  948. <xsl:if test="$strict = 'false' or DR">
  949. <table>
  950. <xsl:call-template name="GenCommonTableAttributes"/>
  951. <xsl:if test="$isNS6">
  952. <xsl:choose>
  953. <xsl:when test="../@style!=''">
  954. <xsl:variable name="sTextAlign" select="substring-after(../@style, 'text-align')"/>
  955. <xsl:variable name="sTextAlignCenter">
  956. <xsl:choose>
  957. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  958. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  959. <xsl:otherwise>false</xsl:otherwise>
  960. </xsl:choose>
  961. </xsl:variable>
  962. <xsl:variable name="sTextAlignRight">
  963. <xsl:choose>
  964. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'right')">true</xsl:when>
  965. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'right')">true</xsl:when>
  966. <xsl:otherwise>false</xsl:otherwise>
  967. </xsl:choose>
  968. </xsl:variable>
  969. <xsl:choose>
  970. <xsl:when test="@style and (../@layoutClass='tableCell' or ../@layoutClass='pageBody') and $sTextAlignCenter='true'">
  971. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  972. </xsl:when>
  973. <xsl:when test="@style and (../@layoutClass='tableCell' or ../@layoutClass='pageBody') and $sTextAlignRight='true'">
  974. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  975. </xsl:when>
  976. </xsl:choose>
  977. <xsl:if test="$sTextAlignCenter='false' and $sTextAlignRight='false' and ../../@style!=''">
  978. <xsl:variable name="sTextAlign2" select="substring-after(../../@style, 'text-align')"/>
  979. <xsl:variable name="sTextAlignCenter2">
  980. <xsl:choose>
  981. <xsl:when test="contains(substring-before($sTextAlign2, ';'), 'center')">true</xsl:when>
  982. <xsl:when test="not(contains($sTextAlign2, ';')) and contains($sTextAlign2, 'center')">true</xsl:when>
  983. <xsl:otherwise>false</xsl:otherwise>
  984. </xsl:choose>
  985. </xsl:variable>
  986. <xsl:variable name="sTextAlignRight2">
  987. <xsl:choose>
  988. <xsl:when test="contains(substring-before($sTextAlign2, ';'), 'right')">true</xsl:when>
  989. <xsl:when test="not(contains($sTextAlign2, ';')) and contains($sTextAlign2, 'right')">true</xsl:when>
  990. <xsl:otherwise>false</xsl:otherwise>
  991. </xsl:choose>
  992. </xsl:variable>
  993. <xsl:choose>
  994. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignCenter2='true'">
  995. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  996. </xsl:when>
  997. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignRight2='true'">
  998. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  999. </xsl:when>
  1000. </xsl:choose>
  1001. </xsl:if>
  1002. </xsl:when>
  1003. <xsl:when test="../../@style!=''">
  1004. <xsl:variable name="sTextAlign" select="substring-after(../../@style, 'text-align')"/>
  1005. <xsl:variable name="sTextAlignCenter">
  1006. <xsl:choose>
  1007. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  1008. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  1009. <xsl:otherwise>false</xsl:otherwise>
  1010. </xsl:choose>
  1011. </xsl:variable>
  1012. <xsl:variable name="sTextAlignRight">
  1013. <xsl:choose>
  1014. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'right')">true</xsl:when>
  1015. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'right')">true</xsl:when>
  1016. <xsl:otherwise>false</xsl:otherwise>
  1017. </xsl:choose>
  1018. </xsl:variable>
  1019. <xsl:choose>
  1020. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignCenter='true'">
  1021. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1022. </xsl:when>
  1023. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignRight='true'">
  1024. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1025. </xsl:when>
  1026. </xsl:choose>
  1027. </xsl:when>
  1028. </xsl:choose>
  1029. </xsl:if>
  1030. <xsl:if test="$strict = 'true' and @name">
  1031. <caption><xsl:value-of select="@name"/></caption>
  1032. </xsl:if>
  1033. <xsl:call-template name="AppPreProcess"/>
  1034. <xsl:apply-templates select="*"/>
  1035. <xsl:call-template name="AppPostProcess"/>
  1036. </table>
  1037. </xsl:if>
  1038. </xsl:when>
  1039. <!--
  1040. repeater
  1041. -->
  1042. <xsl:when test="@layoutClass='repeater'">
  1043. <xsl:choose>
  1044. <xsl:when test="name() = 'DR'">
  1045. <tr>
  1046. <xsl:if test="$accessible='true'">
  1047. <xsl:attribute name="role">row</xsl:attribute>
  1048. </xsl:if>
  1049. <xsl:apply-templates select="*"/>
  1050. </tr>
  1051. </xsl:when>
  1052. <xsl:otherwise>
  1053. <xsl:if test="$strict = 'false' or count (./DR) &gt; 0">
  1054. <table>
  1055. <xsl:call-template name="GenCommonTableAttributes"/>
  1056. <xsl:if test="$isNS6">
  1057. <xsl:choose>
  1058. <xsl:when test="../@style!=''">
  1059. <xsl:variable name="sTextAlign" select="substring-after(../@style, 'text-align')"/>
  1060. <xsl:variable name="sTextAlignCenter">
  1061. <xsl:choose>
  1062. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  1063. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  1064. <xsl:otherwise>false</xsl:otherwise>
  1065. </xsl:choose>
  1066. </xsl:variable>
  1067. <xsl:variable name="sTextAlignRight">
  1068. <xsl:choose>
  1069. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'right')">true</xsl:when>
  1070. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'right')">true</xsl:when>
  1071. <xsl:otherwise>false</xsl:otherwise>
  1072. </xsl:choose>
  1073. </xsl:variable>
  1074. <xsl:choose>
  1075. <xsl:when test="@style and (../@layoutClass='tableCell' or ../@layoutClass='pageBody') and $sTextAlignCenter='true'">
  1076. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1077. </xsl:when>
  1078. <xsl:when test="@style and (../@layoutClass='tableCell' or ../@layoutClass='pageBody') and $sTextAlignRight='true'">
  1079. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1080. </xsl:when>
  1081. </xsl:choose>
  1082. <xsl:if test="$sTextAlignCenter='false' and $sTextAlignRight='false' and ../../@style!=''">
  1083. <xsl:variable name="sTextAlign2" select="substring-after(../../@style, 'text-align')"/>
  1084. <xsl:variable name="sTextAlignCenter2">
  1085. <xsl:choose>
  1086. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  1087. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  1088. <xsl:otherwise>false</xsl:otherwise>
  1089. </xsl:choose>
  1090. </xsl:variable>
  1091. <xsl:variable name="sTextAlignRight2">
  1092. <xsl:choose>
  1093. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'right')">true</xsl:when>
  1094. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'right')">true</xsl:when>
  1095. <xsl:otherwise>false</xsl:otherwise>
  1096. </xsl:choose>
  1097. </xsl:variable>
  1098. <xsl:choose>
  1099. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignCenter2='true'">
  1100. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1101. </xsl:when>
  1102. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignRight2='true'">
  1103. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1104. </xsl:when>
  1105. </xsl:choose>
  1106. </xsl:if>
  1107. </xsl:when>
  1108. <xsl:when test="../../@style!=''">
  1109. <xsl:variable name="sTextAlign" select="substring-after(../../@style, 'text-align')"/>
  1110. <xsl:variable name="sTextAlignCenter">
  1111. <xsl:choose>
  1112. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  1113. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  1114. <xsl:otherwise>false</xsl:otherwise>
  1115. </xsl:choose>
  1116. </xsl:variable>
  1117. <xsl:variable name="sTextAlignRight">
  1118. <xsl:choose>
  1119. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'right')">true</xsl:when>
  1120. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'right')">true</xsl:when>
  1121. <xsl:otherwise>false</xsl:otherwise>
  1122. </xsl:choose>
  1123. </xsl:variable>
  1124. <xsl:choose>
  1125. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignCenter='true'">
  1126. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1127. </xsl:when>
  1128. <xsl:when test="@style and ../../@layoutClass='page' and $sTextAlignRight='true'">
  1129. <xsl:attribute name="style">margin-left:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1130. </xsl:when>
  1131. </xsl:choose>
  1132. </xsl:when>
  1133. </xsl:choose>
  1134. </xsl:if>
  1135. <xsl:call-template name="AppPreProcess"/>
  1136. <xsl:apply-templates select="*"/>
  1137. <xsl:call-template name="AppPostProcess"/>
  1138. </table>
  1139. </xsl:if>
  1140. </xsl:otherwise>
  1141. </xsl:choose>
  1142. </xsl:when>
  1143. <!--
  1144. page
  1145. -->
  1146. <xsl:when test="@layoutClass='page'">
  1147. <table cellpadding="0" cellspacing="0" border="0">
  1148. <xsl:if test="$accessible='true'">
  1149. <xsl:attribute name="role">presentation</xsl:attribute>
  1150. </xsl:if>
  1151. <xsl:variable name="pageName" select="@name"/>
  1152. <xsl:if test="/Document/ReportPageSet/ReportPage[string(@id) = $pageName]">
  1153. <xsl:attribute name="tabid"><xsl:value-of select="$pageName"/></xsl:attribute>
  1154. </xsl:if>
  1155. <xsl:call-template name="GenCommonAttributes"/>
  1156. <xsl:call-template name="GenBackgroundImage"/>
  1157. <xsl:apply-templates select="*"/>
  1158. </table>
  1159. </xsl:when>
  1160. <!--
  1161. block
  1162. -->
  1163. <xsl:when test="@layoutClass='block'">
  1164. <div>
  1165. <xsl:call-template name="GenCommonAttributes"/>
  1166. <xsl:call-template name="GenBackgroundImage"/>
  1167. <xsl:call-template name="AppPreProcess"/>
  1168. <xsl:choose>
  1169. <xsl:when test="./HA[@specname='vizControl']">
  1170. <xsl:choose>
  1171. <xsl:when test="$email='true'">
  1172. <xsl:apply-templates select="OMAP|OCHART|WRAP/OCHART"/>
  1173. </xsl:when>
  1174. <xsl:otherwise>
  1175. <xsl:apply-templates select="*[local-name () != 'OCHART' and local-name () != 'WRAP']"/>
  1176. </xsl:otherwise>
  1177. </xsl:choose>
  1178. </xsl:when>
  1179. <xsl:otherwise>
  1180. <xsl:apply-templates select="*"/>
  1181. </xsl:otherwise>
  1182. </xsl:choose>
  1183. <xsl:call-template name="AppPostProcess"/>
  1184. </div>
  1185. </xsl:when>
  1186. <xsl:when test="@layoutClass='TOC'">
  1187. <div>
  1188. <xsl:if test="$accessible='true'">
  1189. <xsl:attribute name="role">navigation</xsl:attribute>
  1190. <xsl:attribute name="aria-label"><xsl:value-of select="$pageNumberString"/></xsl:attribute>
  1191. </xsl:if>
  1192. <xsl:call-template name="GenCommonAttributes"/>
  1193. <xsl:call-template name="GenBackgroundImage"/>
  1194. <xsl:apply-templates select="*"/>
  1195. </div>
  1196. </xsl:when>
  1197. <xsl:when test="@layoutClass='TOCEntry'">
  1198. <div>
  1199. <xsl:call-template name="GenCommonAttributes"/>
  1200. <xsl:call-template name="GenBackgroundImage"/>
  1201. <xsl:apply-templates select="*"/>
  1202. </div>
  1203. </xsl:when>
  1204. <!--
  1205. pageHeader
  1206. pageFooter
  1207. pageBody
  1208. -->
  1209. <xsl:when test="@layoutClass='pageHeader' or @layoutClass='pageBody' or @layoutClass='pageFooter'">
  1210. <td>
  1211. <xsl:call-template name="GenCommonAttributes"/>
  1212. <xsl:call-template name="GenBackgroundImage"/>
  1213. <xsl:if test="$accessible='true'">
  1214. <xsl:choose>
  1215. <xsl:when test="@layoutClass='pageHeader'">
  1216. <a>
  1217. <xsl:attribute name="href">#rsvpPageBody<xsl:value-of select="$pageNumber"/>-<xsl:value-of select="$viewerID"/></xsl:attribute>
  1218. <xsl:attribute name="style">left: -3000px;position: absolute;width: 500px;</xsl:attribute>
  1219. <xsl:value-of select="$skipLinkText" disable-output-escaping="yes"/>
  1220. </a>
  1221. </xsl:when>
  1222. <xsl:when test="@layoutClass='pageBody'">
  1223. <a>
  1224. <xsl:attribute name="name">rsvpPageBody<xsl:value-of select="$pageNumber"/>-<xsl:value-of select="$viewerID"/></xsl:attribute>
  1225. </a>
  1226. </xsl:when>
  1227. </xsl:choose>
  1228. </xsl:if>
  1229. <xsl:choose>
  1230. <xsl:when test="(@layoutClass='pageBody') and (not(*) or (count(*) = 1 and count(*[@layoutClass='list']) = 1 and not(*[@layoutClass='list']/*)))">
  1231. <xsl:call-template name="startPage"/>
  1232. </xsl:when>
  1233. <xsl:otherwise>
  1234. <xsl:apply-templates select="*"/>
  1235. </xsl:otherwise>
  1236. </xsl:choose>
  1237. </td>
  1238. </xsl:when>
  1239. <!--
  1240. table
  1241. repeaterTable
  1242. -->
  1243. <xsl:when test="@layoutClass='table' or @layoutClass='repeaterTable' or @layoutClass='richTextTable'">
  1244. <xsl:if test="$strict = 'false' or DR or OTR or UNKNOWN">
  1245. <table>
  1246. <xsl:call-template name="GenCommonTableAttributes"/>
  1247. <xsl:if test="$isNS6">
  1248. <xsl:variable name="sTextAlign" select="substring-after(../@style, 'text-align')"/>
  1249. <xsl:variable name="sTextAlignCenter">
  1250. <xsl:choose>
  1251. <xsl:when test="contains(substring-before($sTextAlign, ';'), 'center')">true</xsl:when>
  1252. <xsl:when test="not(contains($sTextAlign, ';')) and contains($sTextAlign, 'center')">true</xsl:when>
  1253. <xsl:otherwise>false</xsl:otherwise>
  1254. </xsl:choose>
  1255. </xsl:variable>
  1256. <xsl:if test="@style and (../@layoutClass='tableCell' or ../@layoutClass='repeaterTableCell') and $sTextAlignCenter='true'">
  1257. <xsl:attribute name="style">margin-left:auto;margin-right:auto;<xsl:value-of select="@style" /></xsl:attribute>
  1258. </xsl:if>
  1259. </xsl:if>
  1260. <xsl:call-template name="AppPreProcess"/>
  1261. <xsl:apply-templates select="*"/>
  1262. <xsl:call-template name="AppPostProcess"/>
  1263. </table>
  1264. </xsl:if>
  1265. </xsl:when>
  1266. <!--
  1267. tableRow
  1268. repeaterTableRow
  1269. -->
  1270. <xsl:when test="@layoutClass='tableRow' or @layoutClass='repeaterTableRow' or @layoutClass='tr'">
  1271. <tr>
  1272. <xsl:if test="$accessible='true' and (@layoutClass='repeaterTableRow' or (@layoutClass='tableRow' and not(../@layoutClass='page') and not(../@isLayoutTable))) ">
  1273. <xsl:attribute name="role">row</xsl:attribute>
  1274. </xsl:if>
  1275. <xsl:call-template name="GenCommonAttributes"/>
  1276. <xsl:call-template name="GenBackgroundImage"/>
  1277. <xsl:apply-templates select="*"/>
  1278. </tr>
  1279. </xsl:when>
  1280. <!--
  1281. tableCell
  1282. repeaterTableCell
  1283. -->
  1284. <xsl:when test="@layoutClass='tableCell' or @layoutClass='repeaterTableCell' or @layoutClass='td' or @layoutClass='th'">
  1285. <xsl:choose>
  1286. <xsl:when test="$accessible='true' and @layoutClass='tableCell' and @tblHdr">
  1287. <th>
  1288. <xsl:call-template name="GenTDAttributes"/>
  1289. <xsl:call-template name="GenEventHandlers"/>
  1290. <xsl:call-template name="GenBackgroundImage"/>
  1291. <xsl:call-template name="GenTDChildElements"/>
  1292. </th>
  1293. </xsl:when>
  1294. <xsl:otherwise>
  1295. <td>
  1296. <xsl:call-template name="GenTDAttributes"/>
  1297. <xsl:call-template name="GenEventHandlers"/>
  1298. <xsl:call-template name="GenBackgroundImage"/>
  1299. <xsl:call-template name="GenTDChildElements"/>
  1300. </td>
  1301. </xsl:otherwise>
  1302. </xsl:choose>
  1303. </xsl:when>
  1304. <!--
  1305. section
  1306. -->
  1307. <xsl:when test="@layoutClass='section'">
  1308. <xsl:if test="$strict = 'false' or DR">
  1309. <table>
  1310. <xsl:apply-templates select="*"/>
  1311. </table>
  1312. </xsl:if>
  1313. </xsl:when>
  1314. <!--
  1315. sectionFooter
  1316. -->
  1317. <xsl:when test="@layoutClass='sectionFooter'"/>
  1318. <!--
  1319. image
  1320. -->
  1321. <xsl:when test="@layoutClass='image' or @layoutClass='richTextImage'">
  1322. <xsl:choose>
  1323. <xsl:when test="@processAttachment">
  1324. <!-- Process the image as if it were a chart -->
  1325. <xsl:call-template name="GenChartImageContainer"/>
  1326. </xsl:when>
  1327. <xsl:otherwise>
  1328. <img>
  1329. <xsl:call-template name="GenTabIndexAttribute"/>
  1330. <xsl:call-template name="AddAccessibleTagsForSpan"/>
  1331. <xsl:call-template name="GenCommonAttributes"/>
  1332. <xsl:choose>
  1333. <xsl:when test="$email='true' and @srcemail">
  1334. <xsl:attribute name="src"><xsl:value-of select="@srcemail"/></xsl:attribute>
  1335. </xsl:when>
  1336. <xsl:otherwise>
  1337. <xsl:if test="@src">
  1338. <xsl:attribute name="src"><xsl:value-of select="@src" /></xsl:attribute>
  1339. </xsl:if>
  1340. </xsl:otherwise>
  1341. </xsl:choose>
  1342. <!-- Yes, this overwrites the src attribute. I cannot find a better way in the rendering engine
  1343. to accomplish this. What happens is that if the image control is data driven, I will set the source
  1344. attribute. This takes presedence over hard-coded src attribute
  1345. -->
  1346. <xsl:if test="@source">
  1347. <xsl:attribute name="src"><xsl:value-of select="@source" /></xsl:attribute>
  1348. </xsl:if>
  1349. <xsl:if test="@URL">
  1350. <xsl:attribute name="src"><xsl:value-of select="@URL" /></xsl:attribute>
  1351. </xsl:if>
  1352. <xsl:choose>
  1353. <xsl:when test="$accessible='true'">
  1354. <xsl:attribute name="alt"><xsl:value-of select="@altText" /></xsl:attribute>
  1355. </xsl:when>
  1356. <xsl:when test="$strict='true'">
  1357. <xsl:attribute name="alt"><xsl:value-of select="@name" /></xsl:attribute>
  1358. </xsl:when>
  1359. </xsl:choose>
  1360. <xsl:call-template name="GenBackgroundImage"/>
  1361. <xsl:apply-templates/>
  1362. </img>
  1363. </xsl:otherwise>
  1364. </xsl:choose>
  1365. </xsl:when>
  1366. <!--
  1367. pieChart
  1368. paretoChart
  1369. scatterChart
  1370. polarChart
  1371. radarChart
  1372. progressiveChart
  1373. combinationChart
  1374. bubbleChart
  1375. threeDCombinationChart
  1376. threeDScatterChart
  1377. gaugeChart
  1378. mapChart
  1379. metricsChart
  1380. marimekkoChart
  1381. CMMMap
  1382. marimekkoChart
  1383. viz
  1384. vizControl
  1385. -->
  1386. <xsl:when test="@layoutClass='pieChart' or @layoutClass='v2_pieChart' or @layoutClass='paretoChart' or @layoutClass='v2_paretoChart' or @layoutClass='scatterChart' or @layoutClass='v2_scatterChart' or @layoutClass='polarChart' or @layoutClass='radarChart' or @layoutClass='progressiveChart' or @layoutClass='v2_progressiveChart' or @layoutClass='combinationChart' or @layoutClass='v2_combinationChart' or @layoutClass='bubbleChart' or @layoutClass='v2_bubbleChart' or @layoutClass='threeDCombinationChart' or @layoutClass='threeDScatterChart' or @layoutClass='gaugeChart' or @layoutClass='v2_gaugeChart' or @layoutClass='metricsChart' or @layoutClass='mapChart' or @layoutClass='CMMMap' or @layoutClass='marimekkoChart' or @layoutClass='viz' or @layoutClass='vizControl'">
  1387. <xsl:if test="string(@useFlash) !='true'">
  1388. <xsl:choose>
  1389. <xsl:when test="string(@checkSvg)='true' and $chartUsesSvg='true'">
  1390. <xsl:call-template name="GenChartImageAsSvg"/>
  1391. </xsl:when>
  1392. <xsl:otherwise>
  1393. <xsl:call-template name="GenChartImageContainer"/>
  1394. </xsl:otherwise>
  1395. </xsl:choose>
  1396. </xsl:if>
  1397. </xsl:when>
  1398. <!--
  1399. chart map
  1400. -->
  1401. <xsl:when test="@layoutClass='chart_map' and count(./*[@layoutClass='chart_area']) &gt; 0">
  1402. <xsl:variable name="sViewChartImageAsSVG">
  1403. <xsl:choose>
  1404. <xsl:when test="string(@checkSvg)='true' and $chartUsesSvg='true'">true</xsl:when>
  1405. <xsl:otherwise>false</xsl:otherwise>
  1406. </xsl:choose>
  1407. </xsl:variable>
  1408. <xsl:if test="$sViewChartImageAsSVG='false'">
  1409. <map>
  1410. <xsl:call-template name="GenCommonAttributes"/>
  1411. <xsl:call-template name="GenEventHandlers"/>
  1412. <xsl:if test="$strict='true'">
  1413. <xsl:attribute name="id">map<xsl:value-of select="$pageNumber"/>-<xsl:value-of select="generate-id(.)"/></xsl:attribute>
  1414. </xsl:if>
  1415. <xsl:if test="@name">
  1416. <xsl:attribute name="name"><xsl:value-of select="$namespaceId"/><xsl:value-of select="@name" /></xsl:attribute>
  1417. </xsl:if>
  1418. <xsl:call-template name="AppPreProcess"/>
  1419. <xsl:choose>
  1420. <xsl:when test="./REVERSE and $chartUsesSvg='true'">
  1421. <xsl:for-each select="./REVERSE/*"><!-- OAREA -->
  1422. <xsl:call-template name="GenChartArea"/>
  1423. </xsl:for-each>
  1424. </xsl:when>
  1425. <xsl:otherwise>
  1426. <xsl:for-each select="./*"><!-- OAREA -->
  1427. <xsl:call-template name="GenChartArea"/>
  1428. </xsl:for-each>
  1429. </xsl:otherwise>
  1430. </xsl:choose>
  1431. <xsl:call-template name="AppPostProcess"/>
  1432. </map>
  1433. </xsl:if>
  1434. </xsl:when>
  1435. <!--
  1436. RichTextItem ol, ul, li, span, div
  1437. -->
  1438. <xsl:when test="@layoutClass='richTextItem'">
  1439. <xsl:apply-templates select="*"/>
  1440. </xsl:when>
  1441. <xsl:when test="@layoutClass='div'">
  1442. <div>
  1443. <xsl:call-template name="GenRTAttributes"/>
  1444. <xsl:apply-templates select="*"/>
  1445. </div>
  1446. </xsl:when>
  1447. <xsl:when test="@layoutClass='span'">
  1448. <span>
  1449. <xsl:call-template name="GenRTAttributes"/>
  1450. <xsl:apply-templates select="*"/>
  1451. </span>
  1452. </xsl:when>
  1453. <xsl:when test="@layoutClass='ol'">
  1454. <ol>
  1455. <xsl:call-template name="GenRTAttributes"/>
  1456. <xsl:apply-templates select="*"/>
  1457. </ol>
  1458. </xsl:when>
  1459. <xsl:when test="@layoutClass='ul'">
  1460. <ul>
  1461. <xsl:call-template name="GenRTAttributes"/>
  1462. <xsl:apply-templates select="*"/>
  1463. </ul>
  1464. </xsl:when>
  1465. <xsl:when test="@layoutClass='li'">
  1466. <li>
  1467. <xsl:call-template name="GenRTAttributes"/>
  1468. <xsl:apply-templates select="*"/>
  1469. </li>
  1470. </xsl:when>
  1471. <!--
  1472. Hyperlink
  1473. -->
  1474. <xsl:when test="name()='OHL'">
  1475. <a href="{@href}">
  1476. <xsl:if test="$strict='false'">
  1477. <xsl:attribute name="target">
  1478. <xsl:choose>
  1479. <xsl:when test="not(@target) or @target=''">_top</xsl:when>
  1480. <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
  1481. </xsl:choose>
  1482. </xsl:attribute>
  1483. </xsl:if>
  1484. <xsl:call-template name="GenCommonAttributes"/>
  1485. <xsl:apply-templates select="*"/>
  1486. </a>
  1487. </xsl:when>
  1488. <!--
  1489. HTML Item
  1490. -->
  1491. <xsl:when test="@layoutClass='HTMLItem'">
  1492. <xsl:value-of disable-output-escaping="yes" select="."/>
  1493. </xsl:when>
  1494. <!--
  1495. Custom Control
  1496. -->
  1497. <xsl:when test="@layoutClass='customControl'">
  1498. <customControl>
  1499. <xsl:copy-of select="HA/@*"/>
  1500. <xsl:if test="./CFG">
  1501. <configuration>
  1502. <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
  1503. <xsl:value-of select="./CFG" disable-output-escaping="yes"/>
  1504. <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
  1505. </configuration>
  1506. </xsl:if>
  1507. <xsl:if test="count(./*[@layoutClass='dataStore']) &gt; 0"><dataStores><xsl:apply-templates select="*"/></dataStores></xsl:if>
  1508. </customControl>
  1509. </xsl:when>
  1510. <!--
  1511. Bookmark
  1512. -->
  1513. <xsl:when test="@layoutClass='bookmark'">
  1514. <a>
  1515. <xsl:choose>
  1516. <xsl:when test="$strict = 'true'">
  1517. <xsl:attribute name="name"><xsl:value-of select="rsext:replace (rsext:urlencode(string(@name)), '+', '-')"/></xsl:attribute>
  1518. </xsl:when>
  1519. <xsl:otherwise>
  1520. <xsl:attribute name="name"><xsl:value-of select="rsext:replace (rsext:urlencode(string(@name)), '+', '-')"/></xsl:attribute>
  1521. </xsl:otherwise>
  1522. </xsl:choose>
  1523. </a>
  1524. </xsl:when>
  1525. <xsl:when test="@layoutClass='TOCBookmark'">
  1526. <a>
  1527. <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  1528. </a>
  1529. </xsl:when>
  1530. <!--
  1531. Button
  1532. -->
  1533. <xsl:when test="@layoutClass='button'">
  1534. <xsl:variable name="sButtonTarget">
  1535. <xsl:choose>
  1536. <xsl:when test="@target and @target != ''"><xsl:value-of select="@target"/></xsl:when>
  1537. <xsl:when test="$hyperlinkButtonNewWindow='false'">_top</xsl:when>
  1538. <xsl:otherwise>_blank</xsl:otherwise>
  1539. </xsl:choose>
  1540. </xsl:variable>
  1541. <xsl:variable name="sCommand">
  1542. <xsl:choose>
  1543. <xsl:when test="not(@href) or @href=''"/>
  1544. <xsl:otherwise>window.open('<xsl:value-of select="@href"/>', '<xsl:value-of select="$sButtonTarget"/>');</xsl:otherwise>
  1545. </xsl:choose>
  1546. </xsl:variable>
  1547. <!-- we are using a table instead of a span, because NS6+ won't render the span correctly if an image is in it -->
  1548. <button type="button" onclick="{$sCommand}">
  1549. <xsl:call-template name="GenCommonAttributes"/>
  1550. <xsl:call-template name="GenBackgroundImage"/>
  1551. <xsl:apply-templates select="*"/>
  1552. </button>
  1553. <!-- if we need NS6 to support images in buttons we can add this in a if for NS6
  1554. <table cellspacing="0" border="0" onMouseDown="{$sCommand}">
  1555. <xsl:call-template name="GenCommonAttributes"/>
  1556. <tr><td>
  1557. <xsl:apply-templates select="*"/>
  1558. </td></tr>
  1559. </table>
  1560. -->
  1561. </xsl:when>
  1562. <xsl:when test="@layoutClass='fieldSet'">
  1563. <fieldset>
  1564. <xsl:call-template name="GenCommonAttributes"/>
  1565. <xsl:call-template name="GenBackgroundImage"/>
  1566. <xsl:apply-templates select="*[name() = 'caption']"/>
  1567. <xsl:apply-templates select="*[not(name() = 'caption')]"/>
  1568. </fieldset>
  1569. </xsl:when>
  1570. <xsl:when test="@layoutClass='fieldSetCaption'">
  1571. <legend>
  1572. <xsl:if test="$strict='false'">
  1573. <xsl:attribute name="align"><xsl:value-of select="./@showCaption"/></xsl:attribute>
  1574. </xsl:if>
  1575. <xsl:call-template name="GenCommonAttributes"/>
  1576. <xsl:call-template name="GenBackgroundImage"/>
  1577. <xsl:apply-templates select="*"/>
  1578. </legend>
  1579. </xsl:when>
  1580. <!--
  1581. textItem
  1582. queryItemRef
  1583. textExpression
  1584. -->
  1585. <xsl:when test="@layoutClass='textItem' or @layoutClass='textExpression' or @layoutClass='richTextContent' or (@layoutClass='hyperlink' and name()='OTI')">
  1586. <span>
  1587. <xsl:call-template name="GenCommonAttributes"/>
  1588. <xsl:call-template name="GenBackgroundImage"/>
  1589. <xsl:value-of select="rsext:htmlencode(.)" disable-output-escaping="yes"/>
  1590. </span>
  1591. </xsl:when>
  1592. <!--
  1593. dataStore
  1594. -->
  1595. <xsl:when test="@layoutClass='dataStore' ">
  1596. <dataStore>
  1597. <xsl:call-template name="GenDataStore"/>
  1598. <xsl:value-of select="rsext:htmlencode(.)" disable-output-escaping="yes"/>
  1599. </dataStore>
  1600. </xsl:when>
  1601. </xsl:choose>
  1602. </xsl:template>
  1603. <xsl:template name="GenChartArea">
  1604. <xsl:if test="@layoutClass='chart_area'">
  1605. <area>
  1606. <xsl:call-template name="GenCommonAttributes"/>
  1607. <xsl:if test="@type and $strict='false'">
  1608. <xsl:attribute name="type"><xsl:value-of select="@type" /></xsl:attribute>
  1609. </xsl:if>
  1610. <xsl:if test="@shape">
  1611. <xsl:attribute name="shape"><xsl:value-of select="@shape" /></xsl:attribute>
  1612. </xsl:if>
  1613. <xsl:if test="@coords">
  1614. <xsl:attribute name="coords"><xsl:value-of select="@coords" /></xsl:attribute>
  1615. </xsl:if>
  1616. <xsl:if test="@title">
  1617. <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
  1618. </xsl:if>
  1619. <xsl:if test="@roid">
  1620. <xsl:attribute name="roid"><xsl:value-of select="@roid" /></xsl:attribute>
  1621. </xsl:if>
  1622. <xsl:if test="@specname">
  1623. <xsl:attribute name="specname"><xsl:value-of select="@specname" /></xsl:attribute>
  1624. </xsl:if>
  1625. <xsl:if test="@ctx">
  1626. <xsl:attribute name="ctx"><xsl:value-of select="@ctx" /></xsl:attribute>
  1627. </xsl:if>
  1628. <xsl:if test="$strict ='false' and $appSupport='false'">
  1629. <xsl:attribute name="tabIndex">-1</xsl:attribute>
  1630. </xsl:if>
  1631. <xsl:if test="@di">
  1632. <xsl:attribute name="di"><xsl:value-of select="@di" /></xsl:attribute>
  1633. </xsl:if>
  1634. <xsl:choose>
  1635. <xsl:when test="$strict='true'">
  1636. <xsl:attribute name="alt"><xsl:value-of select="@type" /></xsl:attribute>
  1637. </xsl:when>
  1638. <xsl:otherwise>
  1639. <xsl:if test="$accessible='true'">
  1640. <xsl:attribute name="alt"><xsl:value-of select="@altText" /></xsl:attribute>
  1641. </xsl:if>
  1642. <!-- apply drill/up down links if meta data exists for this chart area -->
  1643. <xsl:apply-templates select="self::node()"/>
  1644. </xsl:otherwise>
  1645. </xsl:choose>
  1646. </area>
  1647. </xsl:if>
  1648. </xsl:template>
  1649. <!-- sectionHeader DR -->
  1650. <xsl:template match="DR[@layoutClass='sectionHeader']">
  1651. <tr>
  1652. <xsl:if test="$accessible='true'">
  1653. <xsl:attribute name="role">row</xsl:attribute>
  1654. </xsl:if>
  1655. <xsl:apply-templates select="*"/>
  1656. </tr>
  1657. </xsl:template>
  1658. <!-- sectionHeader DRI -->
  1659. <xsl:template match="DRI[@layoutClass='sectionHeader']">
  1660. <td>
  1661. <xsl:call-template name="GenTDAttributes"/>
  1662. <xsl:call-template name="GenEventHandlers"/>
  1663. <xsl:attribute name="class">sh</xsl:attribute>
  1664. <xsl:call-template name="GenBackgroundImage"/>
  1665. <xsl:apply-templates select="*"/>
  1666. </td>
  1667. </xsl:template>
  1668. <!-- sectionBody DR -->
  1669. <xsl:template match="DR[@layoutClass='sectionBody']">
  1670. <tr>
  1671. <xsl:if test="$accessible='true'">
  1672. <xsl:attribute name="role">row</xsl:attribute>
  1673. </xsl:if>
  1674. <xsl:apply-templates select="*"/>
  1675. </tr>
  1676. </xsl:template>
  1677. <!-- sectionBody DRI -->
  1678. <xsl:template match="DRI[@layoutClass='sectionBody']">
  1679. <td>
  1680. <xsl:apply-templates select="*"/>
  1681. </td>
  1682. </xsl:template>
  1683. <!-- XMLItem -->
  1684. <xsl:template match="XMLItem">
  1685. <xsl:value-of disable-output-escaping="yes" select="@value"/>
  1686. </xsl:template>
  1687. <!-- remove bogus row for next or previous controls -->
  1688. <xsl:template match="DR[@type='next'] | DR[@type='previous']"/>
  1689. <!-- FieldSet
  1690. <xsl:template match="fieldSet">
  1691. <fieldset class="fieldset">
  1692. <xsl:if test="@style">
  1693. <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>
  1694. </xsl:if>
  1695. <xsl:call-template name="genCaption">
  1696. <xsl:with-param name="showCaption" select="./@showCaption"/>
  1697. <xsl:with-param name="style" select="./caption/OTI/@style"/>
  1698. <xsl:with-param name="class" select="./caption/OTI/@class"/>
  1699. <xsl:with-param name="caption" select="./caption/OTI"/>
  1700. </xsl:call-template>
  1701. <xsl:apply-templates select="*[not(name() = 'caption')]"/>
  1702. </fieldset>
  1703. </xsl:template>-->
  1704. <xsl:template name="genCaption">
  1705. <xsl:param name="showCaption"/>
  1706. <xsl:param name="style"/>
  1707. <xsl:param name="class"/>
  1708. <xsl:param name="styleId"/>
  1709. <xsl:param name="caption"/>
  1710. <xsl:element name="legend">
  1711. <xsl:if test=" not($showCaption= '') ">
  1712. <xsl:attribute name="align"><xsl:value-of select="$showCaption"/></xsl:attribute>
  1713. </xsl:if>
  1714. <xsl:element name="span">
  1715. <xsl:if test="not($styleId)">
  1716. <xsl:attribute name="style"><xsl:value-of select="$style"/></xsl:attribute>
  1717. </xsl:if>
  1718. <xsl:attribute name="class"><xsl:value-of select="$class"/><xsl:text> </xsl:text><xsl:value-of select="$styleId"/></xsl:attribute>
  1719. <xsl:value-of select="$caption"/>
  1720. </xsl:element>
  1721. </xsl:element>
  1722. </xsl:template>
  1723. <xsl:template name="chartConfig">
  1724. <xsl:if test="$chartSupport = 'true' and $chartSrc != 'srcemail' and $appSupport='false'">
  1725. <script>
  1726. <xsl:if test="$strict='false'">
  1727. <xsl:attribute name="language">javascript</xsl:attribute>
  1728. </xsl:if>
  1729. <xsl:attribute name="type">text/javascript</xsl:attribute>
  1730. <xsl:if test="$Xhtml='true'">
  1731. <xsl:text disable-output-escaping="yes">
  1732. //&lt;![CDATA[
  1733. </xsl:text>
  1734. </xsl:if>
  1735. <xsl:text disable-output-escaping="yes">
  1736. function isIE()
  1737. {
  1738. return (navigator.userAgent.indexOf('MSIE') != -1 || navigator.userAgent.indexOf('Trident') != -1);
  1739. }
  1740. function getNavVer()
  1741. {
  1742. var temp;
  1743. if (isIE()){
  1744. return getIEVersion();
  1745. } else {
  1746. temp = navigator.userAgent.split('\/');
  1747. return parseFloat(temp[temp.length - 1]);
  1748. }
  1749. }
  1750. function getIEVersion()
  1751. {
  1752. var regExMatch = navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);
  1753. return regExMatch ? parseFloat(regExMatch[1]) : null;
  1754. }
  1755. function preprint()
  1756. {
  1757. if (isIE() &amp;&amp; getNavVer() &gt;= 5.5 &amp;&amp; getNavVer() &lt; 7.0) {
  1758. var alltags = document.images;
  1759. for (var i=0; i &lt; alltags.length; i++){
  1760. if (alltags[i].className == 'ch'){
  1761. if (alltags[i].srcbackup){
  1762. alltags[i].src = alltags[i].srcbackup;
  1763. }
  1764. }
  1765. }
  1766. }
  1767. }
  1768. function postprint()
  1769. {
  1770. if (isIE() &amp;&amp; getNavVer() &gt;= 5.5 &amp;&amp; getNavVer() &lt; 7.0) {
  1771. var alltags = document.images;
  1772. for (var i=0; i &lt; alltags.length; i++){
  1773. if (alltags[i].className == 'ch'){
  1774. if (alltags[i].srcbackup){
  1775. alltags[i].src = '../ps/images/space.gif';
  1776. }
  1777. }
  1778. }
  1779. }
  1780. }
  1781. if (isIE() &amp;&amp; getNavVer() &gt;= 5.5 &amp;&amp; getNavVer() &lt; 7.0) {
  1782. window.onbeforeprint=preprint;
  1783. window.onafterprint=postprint;
  1784. }
  1785. function displayChart(imageName, imgSrc, useScale, isImage)
  1786. {
  1787. if (isIE() &amp;&amp; getNavVer() &gt;= 5.5 &amp;&amp; getNavVer() &lt; 7.0) {
  1788. var oImg = document.images[imageName];
  1789. var strOldImg;
  1790. if (imgSrc.length &gt; 1){
  1791. strOldImg = imgSrc;
  1792. } else {
  1793. strOldImg = oImg.src;
  1794. }
  1795. var imgURL = strOldImg;
  1796. oImg.srcbackup = imgURL;
  1797. <!--
  1798. Preserve URL encoding by encoding % character.
  1799. The inbound URL arguments encode %, &, = and +
  1800. The filter expects these to still be encoded so we encoded % as %25 to preserve the encoding
  1801. -->
  1802. strOldImg = strOldImg.replace(new RegExp(/%/g), "%25");
  1803. // BUG: IE's display filter parser is broken and incorrectly sees any closing
  1804. // brackets contained in an href as the end of a filter expression .. so we need to escape them
  1805. strOldImg = strOldImg.replace(/\x28/g, "%28");
  1806. strOldImg = strOldImg.replace(/\x29/g, "%29");
  1807. var strSizing = useScale ? "scale" : "crop";
  1808. if ( isImage ) {
  1809. strSizing = "image";
  1810. }
  1811. </xsl:text>
  1812. <xsl:choose>
  1813. <xsl:when test="$chartEnableTransparencyIE = 'true'">
  1814. <xsl:text disable-output-escaping="yes">
  1815. oImg.src = '../ps/images/space.gif';
  1816. oImg.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + strOldImg + "',sizingMethod='" + strSizing + "');";
  1817. </xsl:text>
  1818. </xsl:when>
  1819. <xsl:otherwise>
  1820. <xsl:text disable-output-escaping="yes">
  1821. document.images[imageName].src = imgURL;
  1822. </xsl:text>
  1823. </xsl:otherwise>
  1824. </xsl:choose>
  1825. <xsl:text disable-output-escaping="yes">
  1826. } else {
  1827. if (imgSrc.length &gt; 1){
  1828. document.images[imageName].src = imgSrc;
  1829. }
  1830. }
  1831. }
  1832. </xsl:text>
  1833. <xsl:if test="$chartSrc = 'srcsave' or $chartSrc='srcsaveAs'">
  1834. <!-- Add code to find saved charts -->
  1835. <xsl:text disable-output-escaping="yes">
  1836. function getSearchStringArgs()
  1837. {
  1838. var args = new Object();
  1839. var query = location.search.substring(1);
  1840. var pairs = query.split("&amp;");
  1841. for(var i = 0; i &lt; pairs.length; i++)
  1842. {
  1843. var pos = pairs[i].indexOf('=');
  1844. if (pos == -1) continue;
  1845. var argname = pairs[i].substring(0,pos);
  1846. if (argname == "search")
  1847. {
  1848. var value = pairs[i].substring(pos+1);
  1849. args[argname] = value;
  1850. break;
  1851. }
  1852. }
  1853. return args;
  1854. }
  1855. var gateway = location.protocol + "//" + location.host + location.pathname;
  1856. var startMethod = "SM=query&amp;search=";
  1857. var searchDelimeter = "?";
  1858. var repositorySuffix = "images/";
  1859. var graphicNamePrefix = "/graphic[@name=\"";
  1860. var graphicNameSuffix = "\"]";
  1861. var endMethod = "&amp;SA=propEnum,properties&amp;ITEM=data&amp;EA=&amp;SS=queryOptions,options&amp;dataEncoding=MIME&amp;ES=&amp;EM=";
  1862. var searchStringArgs = getSearchStringArgs();
  1863. var searchPathToOutput = searchStringArgs["search"];
  1864. function displayBackground (sBackgroundName, sGraphicName, isTest)
  1865. {
  1866. var sGraphicSrc;
  1867. if (isTest) {
  1868. sGraphicSrc = sGraphicName;
  1869. } else {
  1870. sGraphicSrc = resolveGraphicSrc (sGraphicName, true);
  1871. }
  1872. var scriptElement = document.getElementById(sBackgroundName);
  1873. if (scriptElement != null &amp;&amp; scriptElement.parentNode != null)
  1874. scriptElement.parentNode.style.backgroundImage = "url(" + sGraphicSrc + ")";
  1875. }
  1876. function resolveGraphicSrc (sGraphicName, isBackground)
  1877. {
  1878. var sGraphicSrc;
  1879. if (searchPathToOutput != null) {
  1880. var sGraphPath = searchPathToOutput + graphicNamePrefix + sGraphicName + graphicNameSuffix;
  1881. if (isBackground) {
  1882. sGraphPath = urlEncode (sGraphPath);
  1883. }
  1884. sGraphicSrc = gateway + searchDelimeter + startMethod + sGraphPath + endMethod;
  1885. } else if (location.pathname.match(/\/rds\/(outputFormat|sessionOutput)\//gi)) {
  1886. var parts = location.pathname.split("/");
  1887. sGraphicSrc = parts[parts.length - 1] + "/" + repositorySuffix + sGraphicName;
  1888. if (location.pathname.indexOf("/rds/outputFormat/") != -1) {
  1889. sGraphicSrc += location.search
  1890. }
  1891. } else {
  1892. sGraphicSrc = repositorySuffix + sGraphicName;
  1893. }
  1894. return sGraphicSrc;
  1895. }
  1896. <!-- fixed bug COGCQ142700. for firefox, the image URL needs to encode the right bracket and left bracket. And the square bracket can't be encoded.-->
  1897. function urlEncode (sz)
  1898. {
  1899. sz = sz.replace(/\x28/g, "%28");
  1900. sz = sz.replace(/\x29/g, "%29");
  1901. sz = sz.replace(/%5b/g, "[");
  1902. sz = sz.replace(/%5d/g, "]");
  1903. sz = sz.replace(/\x22/g, "%22");
  1904. return sz;
  1905. }
  1906. </xsl:text>
  1907. </xsl:if>
  1908. <xsl:if test="$Xhtml='true'">
  1909. <xsl:text disable-output-escaping="yes">
  1910. //]]&gt;
  1911. </xsl:text>
  1912. </xsl:if>
  1913. </script>
  1914. </xsl:if>
  1915. </xsl:template>
  1916. <!--
  1917. This template is used to generate any output at the start of the first page
  1918. that is common to all transformations (v5html, rv, bux etc.)
  1919. -->
  1920. <xsl:template name="preProcess">
  1921. <xsl:if test="$appSupport='false'">
  1922. <script>
  1923. <xsl:if test="$strict='false'">
  1924. <xsl:attribute name="language">javascript</xsl:attribute>
  1925. </xsl:if>
  1926. <xsl:attribute name="type">text/javascript</xsl:attribute>
  1927. <xsl:if test="$Xhtml='true'">
  1928. <xsl:text disable-output-escaping="yes">//&lt;![CDATA[
  1929. </xsl:text>
  1930. </xsl:if>
  1931. <xsl:text disable-output-escaping="yes">
  1932. function docLocation(label, page, viewer)
  1933. {
  1934. if (page === undefined || viewer === undefined) {
  1935. </xsl:text>
  1936. <xsl:if test="$mht='true'">
  1937. <xsl:text disable-output-escaping="yes"> if (navigator.userAgent.indexOf('MSIE') != -1 || navigator.userAgent.indexOf('Trident') != -1)
  1938. label="mhtml:#"+label;
  1939. else
  1940. </xsl:text>
  1941. </xsl:if>
  1942. <xsl:text disable-output-escaping="yes"> label="#"+label;
  1943. document.location=label;
  1944. }
  1945. else {
  1946. viewer.executeAction("GotoPage",{"pageNumber": page,"anchorName": label});
  1947. }
  1948. }
  1949. function isAllowEmptyStrings()
  1950. {
  1951. return </xsl:text><xsl:value-of select="$PRMT_allowEmptyStrings"/><xsl:text disable-output-escaping="yes">;
  1952. }
  1953. function isAllowEmptyStringHeaderText()
  1954. {
  1955. return </xsl:text><xsl:value-of select="$PRMT_allowEmptyStringTextHeader"/><xsl:text disable-output-escaping="yes">;
  1956. }
  1957. </xsl:text>
  1958. <xsl:if test="$Xhtml='true'">
  1959. <xsl:text disable-output-escaping="yes">//]]&gt;
  1960. </xsl:text>
  1961. </xsl:if>
  1962. </script>
  1963. </xsl:if>
  1964. <xsl:call-template name="textAlignForNonIE"/>
  1965. </xsl:template>
  1966. <xsl:template name="textAlignForNonIE">
  1967. </xsl:template>
  1968. <!--
  1969. This template is used to generate any output at the end of the last page
  1970. that is common to all transformations (v5html, rv, bux etc.)
  1971. -->
  1972. <xsl:template name="postProcess">
  1973. <xsl:param name="elementID"/>
  1974. <xsl:choose>
  1975. <xsl:when test="not($elementID) or $elementID=''">
  1976. <xsl:call-template name="changeDisplayInlineToInlineblockForFireFox">
  1977. <xsl:with-param name="elementID" select="''"/>
  1978. </xsl:call-template>
  1979. <xsl:call-template name="addStyleOverFlowHiddenToTdIfTableLayoutIsFixedForFireFox">
  1980. <xsl:with-param name="elementID" select="''"/>
  1981. </xsl:call-template>
  1982. </xsl:when>
  1983. <xsl:otherwise>
  1984. <xsl:call-template name="changeDisplayInlineToInlineblockForFireFox">
  1985. <xsl:with-param name="elementID" select="$elementID"/>
  1986. </xsl:call-template>
  1987. <xsl:call-template name="addStyleOverFlowHiddenToTdIfTableLayoutIsFixedForFireFox">
  1988. <xsl:with-param name="elementID" select="$elementID"/>
  1989. </xsl:call-template>
  1990. </xsl:otherwise>
  1991. </xsl:choose>
  1992. </xsl:template>
  1993. <!-- just for firefox, if the width and height have been specified and display is inline, change display: inline to inline-block -->
  1994. <xsl:template name="changeDisplayInlineToInlineblockForFireFox">
  1995. <xsl:param name="elementID"/>
  1996. <xsl:if test="$appSupport='false'">
  1997. <script type="text/javascript">
  1998. <xsl:if test="$Xhtml='true'">
  1999. <xsl:text disable-output-escaping="yes">//&lt;![CDATA[
  2000. </xsl:text>
  2001. </xsl:if>
  2002. <xsl:text disable-output-escaping="yes">
  2003. (function(){
  2004. var userAgent = navigator.userAgent.toLowerCase();
  2005. if (userAgent.indexOf ("msie") &lt; 0 || userAgent.indexOf ("trident") &lt; 0 || userAgent.indexOf("firefox") &gt; -1) {
  2006. </xsl:text>
  2007. <xsl:choose>
  2008. <xsl:when test="not($elementID) or $elementID=''">
  2009. <xsl:text disable-output-escaping="yes"> var elmList = document.getElementsByTagName("*");
  2010. </xsl:text>
  2011. </xsl:when>
  2012. <xsl:otherwise>
  2013. <xsl:text disable-output-escaping="yes"> var element = document.getElementById("</xsl:text><xsl:value-of select="$elementID"/><xsl:text disable-output-escaping="yes">");
  2014. var elmList = element.getElementsByTagName("*");
  2015. </xsl:text>
  2016. </xsl:otherwise>
  2017. </xsl:choose>
  2018. <xsl:text disable-output-escaping="yes"> for (var index = 0 ; index &lt; elmList.length; index++){
  2019. var elm = elmList.item(index);
  2020. var sDisplay = elm.style.height &amp;&amp; elm.style.width &amp;&amp; document.defaultView.getComputedStyle(elm, null).getPropertyValue("display");
  2021. var bIsTable = (elm.nodeName === "TABLE");
  2022. if (sDisplay === "inline"){
  2023. elm.style.display = (bIsTable?"inline-table":"inline-block");
  2024. }
  2025. else if (sDisplay === "block" &amp;&amp; bIsTable){
  2026. elm.style.display = "table";
  2027. }
  2028. }
  2029. }
  2030. })();
  2031. </xsl:text>
  2032. <xsl:if test="$Xhtml='true'">
  2033. <xsl:text disable-output-escaping="yes">//]]&gt;</xsl:text>
  2034. </xsl:if>
  2035. </script>
  2036. </xsl:if>
  2037. </xsl:template>
  2038. <!-- just for firefox, if the table-layout property is fixed, add new style property: overflow: hidden to each table cell -->
  2039. <xsl:template name="addStyleOverFlowHiddenToTdIfTableLayoutIsFixedForFireFox">
  2040. <xsl:param name="elementID"/>
  2041. <xsl:if test="$appSupport='false'">
  2042. <script type="text/javascript">
  2043. <xsl:if test="$Xhtml='true'">
  2044. <xsl:text disable-output-escaping="yes">//&lt;![CDATA[
  2045. </xsl:text>
  2046. </xsl:if>
  2047. <xsl:text disable-output-escaping="yes">
  2048. (function(){
  2049. var userAgent = navigator.userAgent.toLowerCase();
  2050. if (userAgent.indexOf ("msie") &lt; 0 || userAgent.indexOf ("trident") &lt; 0 || userAgent.indexOf("firefox") &gt; -1) {
  2051. </xsl:text>
  2052. <xsl:choose>
  2053. <xsl:when test="not($elementID) or $elementID=''">
  2054. <xsl:text disable-output-escaping="yes"> var elmList = document.getElementsByTagName("table");
  2055. </xsl:text>
  2056. </xsl:when>
  2057. <xsl:otherwise>
  2058. <xsl:text disable-output-escaping="yes"> var element = document.getElementById("</xsl:text>
  2059. <xsl:value-of select="$elementID"/>
  2060. <xsl:text disable-output-escaping="yes">");
  2061. var elmList = element.getElementsByTagName("table");
  2062. </xsl:text>
  2063. </xsl:otherwise>
  2064. </xsl:choose>
  2065. <xsl:text disable-output-escaping="yes">
  2066. for (var index = 0 ; index &lt; elmList.length; index++){
  2067. var elm = elmList.item(index);
  2068. if (document.defaultView.getComputedStyle (elm, null).getPropertyValue ("table-layout") === "fixed"){
  2069. for ( var i = 0, row; row = elm.rows[i]; i++){
  2070. for (var j = 0, cell; cell = row.cells[j]; j++) {
  2071. cell.style.overflow = "hidden";
  2072. }
  2073. }
  2074. }
  2075. }
  2076. }
  2077. })();
  2078. </xsl:text>
  2079. <xsl:if test="$Xhtml='true'">
  2080. <xsl:text disable-output-escaping="yes">//]]&gt;</xsl:text>
  2081. </xsl:if>
  2082. </script>
  2083. </xsl:if>
  2084. </xsl:template>
  2085. <!-- For crosstabs and lists only the first cell should have a tabIndex of 0, all other cells need a tabIndex of -1 -->
  2086. <xsl:template name="GenTabIndexAttribute">
  2087. <xsl:if test="$strict ='false' and $appSupport='false'">
  2088. <xsl:choose>
  2089. <xsl:when test="../../../@layoutClass = 'list' or ../../../@layoutClass = 'crosstab' or ../../../../@layoutClass = 'list' or ../../../../@layoutClass = 'crosstab'
  2090. or ancestor::DRI[1]/../../@layoutClass = 'crosstab' or ../../../@layoutClass = 'repeaterTable' or ../../../../@layoutClass = 'repeaterTable' ">
  2091. <xsl:choose>
  2092. <xsl:when test="(../@isFirstCell or ../../@isFirstCell or ancestor::DRI[1]/@isFirstCell) and @isFirstElement"> <!-- the isFirstCell attribute is added to a table's first cell -->
  2093. <xsl:attribute name="tabIndex">0</xsl:attribute>
  2094. </xsl:when>
  2095. <xsl:otherwise>
  2096. <xsl:attribute name="tabIndex">-1</xsl:attribute>
  2097. </xsl:otherwise>
  2098. </xsl:choose>
  2099. </xsl:when>
  2100. <xsl:otherwise>
  2101. <!-- Don't stop on prompt labels as text will be read by prompt control -->
  2102. <xsl:if test="name(..) != 'OLBL'">
  2103. <xsl:attribute name="tabIndex">0</xsl:attribute>
  2104. </xsl:if>
  2105. </xsl:otherwise>
  2106. </xsl:choose>
  2107. </xsl:if>
  2108. <xsl:if test="$appSupport='true'">
  2109. <xsl:if test="not ((../../../@layoutClass = 'list') or (../../../@layoutClass = 'crosstab'))">
  2110. <xsl:if test="@isFirstElement">
  2111. <xsl:attribute name="tabIndex">0</xsl:attribute>
  2112. </xsl:if>
  2113. </xsl:if>
  2114. <xsl:if test="../../../@layoutClass = 'table'">
  2115. <xsl:attribute name="tabIndex">0</xsl:attribute>
  2116. </xsl:if>
  2117. </xsl:if>
  2118. </xsl:template>
  2119. <xsl:template name="AddAccessibleTagsForSpan">
  2120. <xsl:if test="$accessible='true'">
  2121. <xsl:variable name="DRINode" select="ancestor::*[local-name()='DRI'][1]"/>
  2122. <xsl:if test="$DRINode/@headers or $DRINode/@type='summary' or $DRINode/@type='section'">
  2123. <!-- Need a unique id to put on the span for the aria-labelledby -->
  2124. <xsl:variable name="uniqueId"><xsl:value-of select="concat($viewerID, generate-id(.), $pageNumber)"/></xsl:variable>
  2125. <xsl:variable name="siblingId"><xsl:value-of select="concat($viewerID, generate-id($DRINode), 'hiddenspan', $pageNumber)"/></xsl:variable>
  2126. <xsl:attribute name="id"><xsl:value-of select="$uniqueId"/></xsl:attribute>
  2127. <xsl:attribute name="aria-labelledby">
  2128. <xsl:value-of select='concat(rsext:replace($DRINode/@headers, "hdr", concat($viewerID, "hdr")), " ")'/>
  2129. <xsl:if test="$DRINode/@type='summary' or $DRINode/@type='section'"> <!-- add label of the sibling header row/footer row text -->
  2130. <xsl:value-of select='concat($siblingId, " ")'/>
  2131. </xsl:if>
  2132. <xsl:value-of select='$uniqueId'/>
  2133. </xsl:attribute>
  2134. </xsl:if>
  2135. <xsl:if test="@ic and not($DRINode/../../@isLayoutTable or $DRINode/../../../@isLayoutTable) or $appSupport='true'"> <!-- set role only if element is in a cell (ic) and not in a layout table -->
  2136. <xsl:attribute name="role">gridcell</xsl:attribute>
  2137. <!-- for empty gridcells, output a label -->
  2138. <xsl:if test="text()='' or text()=' '">
  2139. <xsl:attribute name="aria-label"><xsl:value-of select="$emptyCellLabelText"/></xsl:attribute>
  2140. </xsl:if>
  2141. </xsl:if>
  2142. </xsl:if>
  2143. </xsl:template>
  2144. <!-- strong emphasis -->
  2145. <xsl:template match="OSTG">
  2146. <strong>
  2147. <xsl:apply-templates select="*"/>
  2148. </strong>
  2149. </xsl:template>
  2150. <!-- emphasis -->
  2151. <xsl:template match="OEM">
  2152. <em>
  2153. <xsl:apply-templates select="*"/>
  2154. </em>
  2155. </xsl:template>
  2156. <!-- heading level 1 -->
  2157. <xsl:template match="OH1">
  2158. <h1>
  2159. <xsl:attribute name="class">h1</xsl:attribute>
  2160. <xsl:apply-templates select="*"/>
  2161. </h1>
  2162. </xsl:template>
  2163. <!-- heading level 2 -->
  2164. <xsl:template match="OH2">
  2165. <h2>
  2166. <xsl:attribute name="class">h2</xsl:attribute>
  2167. <xsl:apply-templates select="*"/>
  2168. </h2>
  2169. </xsl:template>
  2170. <!-- heading level 3 -->
  2171. <xsl:template match="OH3">
  2172. <h3>
  2173. <xsl:attribute name="class">h3</xsl:attribute>
  2174. <xsl:apply-templates select="*"/>
  2175. </h3>
  2176. </xsl:template>
  2177. <!-- heading level 4 -->
  2178. <xsl:template match="OH4">
  2179. <h4>
  2180. <xsl:attribute name="class">h4</xsl:attribute>
  2181. <xsl:apply-templates select="*"/>
  2182. </h4>
  2183. </xsl:template>
  2184. <!-- heading level 5 -->
  2185. <xsl:template match="OH5">
  2186. <h5>
  2187. <xsl:attribute name="class">h5</xsl:attribute>
  2188. <xsl:apply-templates select="*"/>
  2189. </h5>
  2190. </xsl:template>
  2191. <!-- heading level 6 -->
  2192. <xsl:template match="OH6">
  2193. <h6>
  2194. <xsl:attribute name="class">h6</xsl:attribute>
  2195. <xsl:apply-templates select="*"/>
  2196. </h6>
  2197. </xsl:template>
  2198. <!-- labels -->
  2199. <xsl:template match="OLBL">
  2200. <xsl:variable name="promptName"><xsl:value-of select="@labelFor"/></xsl:variable>
  2201. <xsl:variable name="promptControl" select="//*[@name=$promptName]"/>
  2202. <!-- In some cases the prompt control has no form element, so we cannot use a label-for construct -->
  2203. <xsl:variable name="canUseLabelFor">
  2204. <xsl:choose>
  2205. <xsl:when test="name($promptControl[1]) = 'selectValue' and ($promptControl[1]/@selectValueUI='radioGroup'or $promptControl[1]/@selectValueUI='checkboxGroup') or name($promptControl[1]) = 'selectWithTree'">
  2206. <xsl:value-of select="'0'"/>
  2207. </xsl:when>
  2208. <xsl:otherwise>
  2209. <xsl:value-of select="'1'"/>
  2210. </xsl:otherwise>
  2211. </xsl:choose>
  2212. </xsl:variable>
  2213. <xsl:variable name="promptType">
  2214. <xsl:choose>
  2215. <xsl:when test="$canUseLabelFor='0'">
  2216. <!-- if we cannot use the label-for construct, prefix with PRMT_LBL_-->
  2217. <xsl:value-of select="'PRMT_LBL_'"/>
  2218. </xsl:when>
  2219. <xsl:when test="name($promptControl[1]) = 'textBox' or name($promptControl[1]) = 'selectInterval'">
  2220. <xsl:value-of select="'PRMT_TB_'"/>
  2221. </xsl:when>
  2222. <xsl:when test="name($promptControl[1]) = 'selectTime'">
  2223. <xsl:value-of select="'hours'"/>
  2224. </xsl:when>
  2225. <xsl:when test="name($promptControl[1]) = 'selectDateTime' or name($promptControl[1]) = 'selectDate'">
  2226. <xsl:value-of select="'txtDate'"/>
  2227. </xsl:when>
  2228. <xsl:when test="name($promptControl[1]) = 'selectValue'">
  2229. <xsl:value-of select="'PRMT_SV_'"/>
  2230. </xsl:when>
  2231. <xsl:when test="name($promptControl[1]) = 'selectWithSearch'">
  2232. <xsl:value-of select="'swsInput'"/>
  2233. </xsl:when>
  2234. <xsl:when test="name($promptControl[1]) = 'promptButton'">
  2235. <xsl:value-of select="$promptControl[1]/@type"/>
  2236. </xsl:when>
  2237. <xsl:otherwise>
  2238. <xsl:value-of select="''"/>
  2239. </xsl:otherwise>
  2240. </xsl:choose>
  2241. </xsl:variable>
  2242. <xsl:variable name="rangeId">
  2243. <xsl:choose>
  2244. <xsl:when test="$canUseLabelFor='1' and $promptControl[1]/@range = 'true'">
  2245. <xsl:value-of select="'F_'"/>
  2246. </xsl:when>
  2247. <xsl:otherwise>
  2248. <xsl:value-of select="''"/>
  2249. </xsl:otherwise>
  2250. </xsl:choose>
  2251. </xsl:variable>
  2252. <xsl:variable name="promptIdSuffix">
  2253. <xsl:choose>
  2254. <xsl:when test="$canUseLabelFor='1' and name($promptControl[1]) = 'selectInterval'">
  2255. <xsl:value-of select="'[D]'"/>
  2256. </xsl:when>
  2257. <xsl:otherwise>
  2258. <xsl:value-of select="''"/>
  2259. </xsl:otherwise>
  2260. </xsl:choose>
  2261. </xsl:variable>
  2262. <xsl:variable name="targetId">
  2263. <xsl:choose>
  2264. <!-- Only define the target id if we have a valid promptType -->
  2265. <xsl:when test="$promptType != ''">
  2266. <xsl:value-of select="concat($promptType, $rangeId, translate(generate-id($promptControl[1]), '.', 'x'), $CognosViewerID, $promptIdSuffix)"/>
  2267. </xsl:when>
  2268. <xsl:otherwise>
  2269. <xsl:value-of select="''"/>
  2270. </xsl:otherwise>
  2271. </xsl:choose>
  2272. </xsl:variable>
  2273. <label>
  2274. <xsl:if test="$targetId != ''">
  2275. <xsl:choose>
  2276. <!-- Only add a 'for' attribute if we can, otherwise add an id (for the aria-labelledby to reference) -->
  2277. <xsl:when test="$canUseLabelFor='1'">
  2278. <xsl:attribute name="for"><xsl:value-of select="$targetId"/></xsl:attribute>
  2279. </xsl:when>
  2280. <xsl:otherwise>
  2281. <xsl:attribute name="id"><xsl:value-of select="$targetId"/></xsl:attribute>
  2282. </xsl:otherwise>
  2283. </xsl:choose>
  2284. </xsl:if>
  2285. <xsl:apply-templates select="*"/>
  2286. </label>
  2287. </xsl:template>
  2288. <!--
  2289. This template is used to generate specific for App compression
  2290. -->
  2291. <xsl:template match="APP-CONTEXT-DATA"></xsl:template>
  2292. <xsl:template name="AppPreProcess">
  2293. <xsl:if test="$appSupport='true'">
  2294. <xsl:if test="@compress_candidate='true'"><CompressStart/></xsl:if>
  2295. </xsl:if>
  2296. <xsl:if test="./APP-CONTEXT-DATA">
  2297. <ctxData>
  2298. <xsl:choose>
  2299. <xsl:when test="./APP-CONTEXT-DATA/@compress_candidate='true'"><CompressStart/></xsl:when>
  2300. <xsl:otherwise><xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text></xsl:otherwise>
  2301. </xsl:choose>
  2302. <xsl:value-of select="./APP-CONTEXT-DATA" disable-output-escaping="yes"/>
  2303. <xsl:choose>
  2304. <xsl:when test="./APP-CONTEXT-DATA/@compress_candidate='true'"><CompressEnd/></xsl:when>
  2305. <xsl:otherwise><xsl:text disable-output-escaping="yes">]]&gt;</xsl:text></xsl:otherwise>
  2306. </xsl:choose>
  2307. </ctxData>
  2308. </xsl:if>
  2309. </xsl:template>
  2310. <xsl:template name="AppPostProcess">
  2311. <xsl:if test="$appSupport='true'">
  2312. <xsl:if test="@compress_candidate='true'"><CompressEnd/></xsl:if>
  2313. </xsl:if>
  2314. </xsl:template>
  2315. <!-- Active report data store-->
  2316. <xsl:template name="GenDataStore">
  2317. <xsl:if test="@dataStoreIndex">
  2318. <xsl:attribute name="idxStore"><xsl:value-of select="@dataStoreIndex" /></xsl:attribute>
  2319. <xsl:if test="@dataStorePart">
  2320. <xsl:attribute name="idxPart"><xsl:value-of select="@dataStorePart" /></xsl:attribute>
  2321. </xsl:if>
  2322. </xsl:if>
  2323. <xsl:if test="@geoDataStoreIndex">
  2324. <xsl:attribute name="idxGeoStore">
  2325. <xsl:value-of select="@geoDataStoreIndex" />
  2326. </xsl:attribute>
  2327. </xsl:if>
  2328. <xsl:if test="@name">
  2329. <xsl:attribute name="name"><xsl:value-of select="@name" /></xsl:attribute>
  2330. </xsl:if>
  2331. <xsl:choose>
  2332. <xsl:when test="$chartSrc = 'src' and @src">
  2333. <xsl:attribute name="src">
  2334. <xsl:choose>
  2335. <xsl:when test="starts-with(@src, '?b_action')">
  2336. <xsl:value-of select="$CVGateway"/>
  2337. <xsl:value-of select="@src"/>
  2338. </xsl:when>
  2339. <xsl:when test="starts-with(@src, '/repository')">
  2340. <xsl:text/>/<xsl:value-of select="substring-after(substring-after($gatewayPath, '//'),'/')"/><xsl:value-of select="@src"/>
  2341. </xsl:when>
  2342. <xsl:otherwise>
  2343. <xsl:value-of select="@src"/>
  2344. </xsl:otherwise>
  2345. </xsl:choose>
  2346. </xsl:attribute>
  2347. </xsl:when>
  2348. <xsl:when test="$chartSrc = 'srcemail' and @srcemail">
  2349. <xsl:attribute name="src">
  2350. <xsl:value-of select="@srcemail" />
  2351. </xsl:attribute>
  2352. </xsl:when>
  2353. <xsl:when test="$chartSrc = 'srcmobile' and @srcmobile">
  2354. <xsl:attribute name="src">
  2355. <xsl:value-of select="@srcmobile" />
  2356. </xsl:attribute>
  2357. </xsl:when>
  2358. <xsl:when test="$chartSrc = 'srcsaveAs' and @srcsaveAs">
  2359. <xsl:attribute name="src">
  2360. <xsl:value-of select="@srcsaveAs" />
  2361. </xsl:attribute>
  2362. </xsl:when>
  2363. <xsl:when test="$chartSrc = 'srcsave' and @srcsave">
  2364. <xsl:attribute name="src">
  2365. <xsl:value-of select="@srcsave" />
  2366. </xsl:attribute>
  2367. </xsl:when>
  2368. </xsl:choose>
  2369. <xsl:choose>
  2370. <xsl:when test="$chartSrc = 'src' and @geosrc">
  2371. <xsl:attribute name="geosrc">
  2372. <xsl:choose>
  2373. <xsl:when test="starts-with(@geosrc, '?b_action')">
  2374. <xsl:value-of select="$CVGateway"/>
  2375. <xsl:value-of select="@geosrc"/>
  2376. </xsl:when>
  2377. <xsl:when test="starts-with(@geosrc, '/repository')">
  2378. <xsl:text/>/<xsl:value-of select="substring-after(substring-after($gatewayPath, '//'),'/')"/><xsl:value-of select="@geosrc"/>
  2379. </xsl:when>
  2380. <xsl:otherwise>
  2381. <xsl:value-of select="@geosrc"/>
  2382. </xsl:otherwise>
  2383. </xsl:choose>
  2384. </xsl:attribute>
  2385. </xsl:when>
  2386. <xsl:when test="$chartSrc = 'srcemail' and @geosrcemail">
  2387. <xsl:attribute name="geosrc">
  2388. <xsl:value-of select="@geosrcemail" />
  2389. </xsl:attribute>
  2390. </xsl:when>
  2391. <xsl:when test="$chartSrc = 'srcmobile' and @geosrcmobile">
  2392. <xsl:attribute name="geosrc">
  2393. <xsl:value-of select="@geosrcmobile" />
  2394. </xsl:attribute>
  2395. </xsl:when>
  2396. <xsl:when test="$chartSrc = 'srcsaveAs' and @geosrcsaveAs">
  2397. <xsl:attribute name="geosrc">
  2398. <xsl:value-of select="@geosrcsaveAs" />
  2399. </xsl:attribute>
  2400. </xsl:when>
  2401. <xsl:when test="$chartSrc = 'srcsave' and @geosrcsave">
  2402. <xsl:attribute name="geosrc">
  2403. <xsl:value-of select="@geosrcsave" />
  2404. </xsl:attribute>
  2405. </xsl:when>
  2406. </xsl:choose>
  2407. <xsl:if test="@rowCount">
  2408. <xsl:attribute name="rowCount">
  2409. <xsl:value-of select="@rowCount" />
  2410. </xsl:attribute>
  2411. </xsl:if>
  2412. <xsl:if test="@colCount">
  2413. <xsl:attribute name="colCount">
  2414. <xsl:value-of select="@colCount" />
  2415. </xsl:attribute>
  2416. </xsl:if>
  2417. <xsl:if test="@cellCount">
  2418. <xsl:attribute name="cellCount">
  2419. <xsl:value-of select="@cellCount" />
  2420. </xsl:attribute>
  2421. </xsl:if>
  2422. </xsl:template>
  2423. <xsl:template name="createJsonTabset">
  2424. <xsl:param name="node"/>
  2425. <xsl:text disable-output-escaping="yes">{"tabs":[</xsl:text>
  2426. <xsl:variable name="curTabId" select="$node/@currentId"/>
  2427. <xsl:variable name="position" select="$node/@position"/>
  2428. <xsl:for-each select="$node/ReportPage">
  2429. <xsl:if test="position() > 1"><xsl:text disable-output-escaping="yes">,</xsl:text></xsl:if>
  2430. <xsl:text disable-output-escaping="yes">{"id":"</xsl:text>
  2431. <xsl:value-of select="rsext:jsonencode(@id)"/>
  2432. <xsl:text disable-output-escaping="yes">","label":"</xsl:text>
  2433. <xsl:value-of select="rsext:jsonencode(.)"/>
  2434. <xsl:text disable-output-escaping="yes">"</xsl:text>
  2435. <xsl:if test="@pages">
  2436. <xsl:text disable-output-escaping="yes">,"pages":</xsl:text>
  2437. <xsl:value-of select="rsext:jsonencode(@pages)"/>
  2438. </xsl:if>
  2439. <xsl:text disable-output-escaping="yes">}</xsl:text>
  2440. </xsl:for-each>
  2441. <xsl:text disable-output-escaping="yes">],</xsl:text>
  2442. <xsl:text disable-output-escaping="yes">"currentTabId":"</xsl:text>
  2443. <xsl:value-of select="rsext:jsonencode($curTabId)"/>
  2444. <xsl:text disable-output-escaping="yes">","position":"</xsl:text>
  2445. <xsl:value-of select="$position"/>
  2446. <xsl:text disable-output-escaping="yes">"}</xsl:text>
  2447. </xsl:template>
  2448. <xsl:template match="reportDrillTargets">
  2449. <xsl:if test="$appSupport='true'">
  2450. <reportDrillTargets>
  2451. <xsl:for-each select="*">
  2452. <reportDrillTarget>
  2453. <xsl:attribute name="idxDrill">
  2454. <xsl:value-of select="@idxDrill"></xsl:value-of>
  2455. </xsl:attribute>
  2456. </reportDrillTarget>
  2457. </xsl:for-each>
  2458. </reportDrillTargets>
  2459. </xsl:if>
  2460. </xsl:template>
  2461. <xsl:template match="WRAP">
  2462. <div class="q-div">
  2463. <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>
  2464. <xsl:apply-templates />
  2465. </div>
  2466. </xsl:template>
  2467. <xsl:template match="WRAPTABLE">
  2468. <table class="q-table">
  2469. <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>
  2470. <tbody>
  2471. <tr>
  2472. <td class="q-td">
  2473. <xsl:apply-templates />
  2474. </td>
  2475. </tr>
  2476. </tbody>
  2477. </table>
  2478. </xsl:template>
  2479. </xsl:stylesheet>