prompts.xsl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: CCS
  5. (c) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ccs="http://developer.cognos.com/rds/1" version="1.0">
  9. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" version="1.0"/>
  10. <xsl:param name="pagenum">1</xsl:param>
  11. <xsl:template match="/">
  12. <xsl:apply-templates select="Document/DATA/PAGE"/>
  13. </xsl:template>
  14. <!-- first the metadata templates -->
  15. <xsl:template match="LIST">
  16. <xsl:for-each select="DR/DRI/*">
  17. <xsl:apply-templates select="."/>
  18. </xsl:for-each>
  19. <xsl:for-each select="OTR/DRI/*">
  20. <xsl:apply-templates select="."/>
  21. </xsl:for-each>
  22. </xsl:template>
  23. <xsl:template match="FORM">
  24. <xsl:for-each select="*">
  25. <xsl:apply-templates select="."/>
  26. </xsl:for-each>
  27. </xsl:template>
  28. <xsl:template match="PAGE">
  29. <ccs:morePrompts>
  30. <xsl:value-of select="@canFinish='false'"/>
  31. </ccs:morePrompts>
  32. <xsl:apply-templates/>
  33. </xsl:template>
  34. <!-- Prompt types -->
  35. <!-- select value prompt -->
  36. <xsl:template match="selectValue">
  37. <ccs:prompts>
  38. <ccs:id/>
  39. <ccs:name/>
  40. <ccs:type>Prompt</ccs:type>
  41. <ccs:content>
  42. <ccs:prompt>
  43. <ccs:name>
  44. <xsl:value-of select="@parameter"/>
  45. </ccs:name>
  46. <ccs:type>selectValue</ccs:type>
  47. <ccs:required>
  48. <xsl:value-of select="@required"/>
  49. </ccs:required>
  50. <ccs:multiselect>
  51. <xsl:value-of select="@multiSelect"/>
  52. </ccs:multiselect>
  53. <ccs:range>
  54. <xsl:value-of select="@range"/>
  55. </ccs:range>
  56. <ccs:showAdornments>
  57. <xsl:value-of select="@hideAdornments='false'"/>
  58. </ccs:showAdornments>
  59. <ccs:promptInfo>
  60. <ccs:selectValue>
  61. <ccs:autoSubmit>
  62. <xsl:value-of select="@autoSubmit"/>
  63. </ccs:autoSubmit>
  64. <ccs:selectUI>
  65. <xsl:choose>
  66. <xsl:when test="@selectValueUI='dropdown'">dropDownList</xsl:when>
  67. <xsl:when test="@selectValueUI='listBox'">listBox</xsl:when>
  68. <xsl:when test="@selectValueUI='radioGroup'">radioButtonGroup</xsl:when>
  69. <xsl:otherwise>unknown</xsl:otherwise>
  70. </xsl:choose>
  71. </ccs:selectUI>
  72. <xsl:for-each select="selectOptions/selectOption">
  73. <ccs:options>
  74. <ccs:useValue>
  75. <xsl:value-of select="@useValue"/>
  76. </ccs:useValue>
  77. <ccs:displayValue>
  78. <xsl:value-of select="@displayValue"/>
  79. </ccs:displayValue>
  80. </ccs:options>
  81. </xsl:for-each>
  82. </ccs:selectValue>
  83. </ccs:promptInfo>
  84. </ccs:prompt>
  85. </ccs:content>
  86. </ccs:prompts>
  87. </xsl:template>
  88. <!--textbox prompt -->
  89. <xsl:template match="textBox">
  90. <ccs:prompts>
  91. <ccs:id/>
  92. <ccs:name/>
  93. <ccs:type>Prompt</ccs:type>
  94. <ccs:content>
  95. <ccs:prompt>
  96. <ccs:name>
  97. <xsl:value-of select="@parameter"/>
  98. </ccs:name>
  99. <ccs:type>textBox</ccs:type>
  100. <ccs:required>
  101. <xsl:value-of select="@required"/>
  102. </ccs:required>
  103. <ccs:multiselect>
  104. <xsl:value-of select="@multiSelect"/>
  105. </ccs:multiselect>
  106. <ccs:range>
  107. <xsl:value-of select="@range"/>
  108. </ccs:range>
  109. <ccs:showAdornments>
  110. <xsl:value-of select="@hideAdornments='false'"/>
  111. </ccs:showAdornments>
  112. <ccs:promptInfo>
  113. <ccs:textBox>
  114. <ccs:useThousandsSep>
  115. <xsl:value-of select="@showThousandSeparator"/>
  116. </ccs:useThousandsSep>
  117. <ccs:numbersOnly>
  118. <xsl:value-of select="@numbersOnly"/>
  119. </ccs:numbersOnly>
  120. <ccs:multiLine>
  121. <xsl:value-of select="@multiLine"/>
  122. </ccs:multiLine>
  123. <ccs:hideText>
  124. <xsl:value-of select="@hideText"/>
  125. </ccs:hideText>
  126. </ccs:textBox>
  127. </ccs:promptInfo>
  128. </ccs:prompt>
  129. </ccs:content>
  130. </ccs:prompts>
  131. </xsl:template>
  132. <!-- select and search prompt -->
  133. <xsl:template match="selectWithSearch">
  134. <ccs:prompts>
  135. <ccs:id/>
  136. <ccs:name/>
  137. <ccs:type>Prompt</ccs:type>
  138. <ccs:content>
  139. <ccs:prompt>
  140. <ccs:name>
  141. <xsl:value-of select="@parameter"/>
  142. </ccs:name>
  143. <ccs:type>selectSearch</ccs:type>
  144. <ccs:required>
  145. <xsl:value-of select="@required"/>
  146. </ccs:required>
  147. <ccs:multiselect>
  148. <xsl:value-of select="@multiSelect"/>
  149. </ccs:multiselect>
  150. <ccs:range>
  151. <xsl:value-of select="@range"/>
  152. </ccs:range>
  153. <ccs:showAdornments>
  154. <xsl:value-of select="@hideAdornments='false'"/>
  155. </ccs:showAdornments>
  156. <ccs:promptInfo>
  157. <ccs:selectSearch>
  158. </ccs:selectSearch>
  159. </ccs:promptInfo>
  160. </ccs:prompt>
  161. </ccs:content>
  162. </ccs:prompts>
  163. </xsl:template>
  164. <!-- dateTime prompt -->
  165. <xsl:template match="selectDateTime">
  166. <ccs:prompts>
  167. <ccs:id/>
  168. <ccs:name/>
  169. <ccs:type>Prompt</ccs:type>
  170. <ccs:content>
  171. <ccs:prompt>
  172. <ccs:name>
  173. <xsl:value-of select="@parameter"/>
  174. </ccs:name>
  175. <ccs:type>dateTime</ccs:type>
  176. <ccs:required>
  177. <xsl:value-of select="@required"/>
  178. </ccs:required>
  179. <ccs:multiselect>
  180. <xsl:value-of select="@multiSelect"/>
  181. </ccs:multiselect>
  182. <ccs:range>
  183. <xsl:value-of select="@range"/>
  184. </ccs:range>
  185. <ccs:showAdornments>
  186. <xsl:value-of select="@hideAdornments='false'"/>
  187. </ccs:showAdornments>
  188. <ccs:promptInfo>
  189. <ccs:dateTime>
  190. <ccs:selectUI>
  191. <xsl:choose>
  192. <xsl:when test="@selectDateTimeUI='calendar'">calendar</xsl:when>
  193. <xsl:when test="@selectDateTimeUI='editBox'">editBox</xsl:when>
  194. <xsl:otherwise>unknown</xsl:otherwise>
  195. </xsl:choose>
  196. </ccs:selectUI>
  197. <ccs:calendarType>
  198. <xsl:choose>
  199. <xsl:when test="@calendar='Gregorian'">gregorian</xsl:when>
  200. <xsl:when test="@calendar='Imperial'">japanImperial</xsl:when>
  201. <xsl:otherwise>unknown</xsl:otherwise>
  202. </xsl:choose>
  203. </ccs:calendarType>
  204. <ccs:isStatic>
  205. <xsl:choose>
  206. <xsl:when test="@mode='static'">true</xsl:when>
  207. <xsl:otherwise>false</xsl:otherwise>
  208. </xsl:choose>
  209. </ccs:isStatic>
  210. <ccs:firstDate>
  211. <xsl:choose>
  212. <xsl:when test="@firstDate">
  213. <xsl:value-of select="@firstDate"/>T00:00:00 </xsl:when>
  214. <xsl:otherwise>0001-01-01T00:00:00</xsl:otherwise>
  215. </xsl:choose>
  216. </ccs:firstDate>
  217. <ccs:lastDate>
  218. <xsl:choose>
  219. <xsl:when test="@lastDate">
  220. <xsl:value-of select="@lastDate"/>T23:59:59</xsl:when>
  221. <xsl:otherwise>9999-12-31T23:59:59</xsl:otherwise>
  222. </xsl:choose>
  223. </ccs:lastDate>
  224. <ccs:displaySeconds>
  225. <xsl:value-of select="@showSeconds"/>
  226. </ccs:displaySeconds>
  227. <ccs:displayMilliseconds>
  228. <xsl:value-of select="@showMilliseconds"/>
  229. </ccs:displayMilliseconds>
  230. </ccs:dateTime>
  231. </ccs:promptInfo>
  232. </ccs:prompt>
  233. </ccs:content>
  234. </ccs:prompts>
  235. </xsl:template>
  236. <!-- time prompt -->
  237. <xsl:template match="selectTime">
  238. <ccs:prompts>
  239. <ccs:id/>
  240. <ccs:name/>
  241. <ccs:type>Prompt</ccs:type>
  242. <ccs:content>
  243. <ccs:prompt>
  244. <ccs:name>
  245. <xsl:value-of select="@parameter"/>
  246. </ccs:name>
  247. <ccs:type>time</ccs:type>
  248. <ccs:required>
  249. <xsl:value-of select="@required"/>
  250. </ccs:required>
  251. <ccs:multiselect>
  252. <xsl:value-of select="@multiSelect"/>
  253. </ccs:multiselect>
  254. <ccs:range>
  255. <xsl:value-of select="@range"/>
  256. </ccs:range>
  257. <ccs:showAdornments>
  258. <xsl:value-of select="@hideAdornments='false'"/>
  259. </ccs:showAdornments>
  260. <ccs:promptInfo>
  261. <ccs:time>
  262. <ccs:isStatic>
  263. <xsl:choose>
  264. <xsl:when test="@mode='static'">true</xsl:when>
  265. <xsl:otherwise>false</xsl:otherwise>
  266. </xsl:choose>
  267. </ccs:isStatic>
  268. <ccs:displaySeconds>
  269. <xsl:value-of select="@showSeconds"/>
  270. </ccs:displaySeconds>
  271. <ccs:displayMilliseconds>
  272. <xsl:value-of select="@showMilliseconds"/>
  273. </ccs:displayMilliseconds>
  274. </ccs:time>
  275. </ccs:promptInfo>
  276. </ccs:prompt>
  277. </ccs:content>
  278. </ccs:prompts>
  279. </xsl:template>
  280. <!-- date prompt -->
  281. <xsl:template match="selectDate">
  282. <ccs:prompts>
  283. <ccs:id/>
  284. <ccs:name/>
  285. <ccs:type>Prompt</ccs:type>
  286. <ccs:content>
  287. <ccs:prompt>
  288. <ccs:name>
  289. <xsl:value-of select="@parameter"/>
  290. </ccs:name>
  291. <ccs:type>date</ccs:type>
  292. <ccs:required>
  293. <xsl:value-of select="@required"/>
  294. </ccs:required>
  295. <ccs:multiselect>
  296. <xsl:value-of select="@multiSelect"/>
  297. </ccs:multiselect>
  298. <ccs:range>
  299. <xsl:value-of select="@range"/>
  300. </ccs:range>
  301. <ccs:showAdornments>
  302. <xsl:value-of select="@hideAdornments='false'"/>
  303. </ccs:showAdornments>
  304. <ccs:promptInfo>
  305. <ccs:date>
  306. <ccs:selectUI>
  307. <xsl:choose>
  308. <xsl:when test="@selectDateUI='calendar'">calendar</xsl:when>
  309. <xsl:when test="@selectDateUI='editBox'">editBox</xsl:when>
  310. <xsl:otherwise>unknown</xsl:otherwise>
  311. </xsl:choose>
  312. </ccs:selectUI>
  313. <ccs:calendarType>
  314. <xsl:choose>
  315. <xsl:when test="@calendar='Gregorian'">gregorian</xsl:when>
  316. <xsl:when test="@calendar='Imperial'">japanImperial</xsl:when>
  317. <xsl:otherwise>unknown</xsl:otherwise>
  318. </xsl:choose>
  319. </ccs:calendarType>
  320. <ccs:firstDate>
  321. <xsl:choose>
  322. <xsl:when test="@firstDate">
  323. <xsl:value-of select="@firstDate"/>T00:00:00</xsl:when>
  324. <xsl:otherwise>9999-12-31T23:59:59</xsl:otherwise>
  325. </xsl:choose>
  326. </ccs:firstDate>
  327. <ccs:lastDate>
  328. <xsl:choose>
  329. <xsl:when test="@lastDate">
  330. <xsl:value-of select="@lastDate"/>T23:59:59</xsl:when>
  331. <xsl:otherwise>9999-12-31T23:59:59</xsl:otherwise>
  332. </xsl:choose>
  333. </ccs:lastDate>
  334. </ccs:date>
  335. </ccs:promptInfo>
  336. </ccs:prompt>
  337. </ccs:content>
  338. </ccs:prompts>
  339. </xsl:template>
  340. <!-- interval prompt -->
  341. <xsl:template match="selectInterval">
  342. <ccs:prompts>
  343. <ccs:id/>
  344. <ccs:name/>
  345. <ccs:type>Prompt</ccs:type>
  346. <ccs:content>
  347. <ccs:prompt>
  348. <ccs:name>
  349. <xsl:value-of select="@parameter"/>
  350. </ccs:name>
  351. <ccs:type>interval</ccs:type>
  352. <ccs:required>
  353. <xsl:value-of select="@required"/>
  354. </ccs:required>
  355. <ccs:multiselect>
  356. <xsl:value-of select="@multiSelect"/>
  357. </ccs:multiselect>
  358. <ccs:range>
  359. <xsl:value-of select="@range"/>
  360. </ccs:range>
  361. <ccs:showAdornments>
  362. <xsl:value-of select="@hideAdornments='false'"/>
  363. </ccs:showAdornments>
  364. <ccs:promptInfo>
  365. <ccs:interval>
  366. <ccs:displaySeconds>
  367. <xsl:value-of select="@showSeconds"/>
  368. </ccs:displaySeconds>
  369. <ccs:displayMilliseconds>
  370. <xsl:value-of select="@showMilliseconds"/>
  371. </ccs:displayMilliseconds>
  372. </ccs:interval>
  373. </ccs:promptInfo>
  374. </ccs:prompt>
  375. </ccs:content>
  376. </ccs:prompts>
  377. </xsl:template>
  378. <xsl:template match="OTI"/>
  379. <xsl:template match="OIMG"/>
  380. </xsl:stylesheet>