promptTree.xts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--
  3. +===================================================================+
  4. | Licensed Materials - Property of IBM
  5. | BI and PM: prmt
  6. | (C) Copyright IBM Corp. 2002, 2019
  7. |
  8. | US Government Users Restricted Rights - Use, duplication or
  9. | disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  10. |
  11. +===================================================================+
  12. -->
  13. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/">
  14. <xts:block id="wait" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='m_tracking'] and /root/env/param[@name='doWait']='1']" mandatory="false">
  15. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  16. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  17. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  18. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  19. <xsl:template match="/">
  20. <xts:sequence>
  21. <xts:append select="/root">
  22. <response>
  23. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/202004/.absolute" faultBlock="faultHandler" responseEnvelope="true" outputHeader="true">
  24. <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  25. <SOAP-ENV:Header>
  26. <bus:biBusHeader xsi:type="bus:biBusHeader">
  27. <bus:tracking>
  28. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','m_tracking'))), true())" disable-output-escaping="yes"/>
  29. </bus:tracking>
  30. <xsl:apply-templates select="/root/header/*[local-name() = 'biBusHeader']/*[local-name() != 'tracking']"/>
  31. </bus:biBusHeader>
  32. </SOAP-ENV:Header>
  33. <SOAP-ENV:Body>
  34. <xsl:element name="wait" namespace="http://developer.cognos.com/schemas/reportService/1">
  35. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:nil="true"/>
  36. <bus:parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  37. <bus:options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"/>
  38. </xsl:element>
  39. </SOAP-ENV:Body>
  40. </SOAP-ENV:Envelope>
  41. </xts:request>
  42. </response>
  43. </xts:append>
  44. </xts:sequence>
  45. </xsl:template>
  46. <!-- don't include superfluous fields in Envelope -->
  47. <xsl:template match="*[local-name()='formFieldVars']/item[name='inlineSpec' or name='conversation' or name='previousConversation' or name='cancelStack']"/>
  48. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  49. <xsl:template match="*">
  50. <xsl:copy>
  51. <xsl:copy-of select="@*"/>
  52. <xsl:apply-templates/>
  53. </xsl:copy>
  54. </xsl:template>
  55. </xsl:stylesheet>
  56. </xts:block>
  57. <xts:block id="prependDocument" mode="interpret" processor="XSLT" type="exec" condition=".[not(/root/env/param[@name = 'doWait'])]" mandatory="false">
  58. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl xtsext">
  59. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  60. <xsl:key name="env-param" match="/root/env/param" use="@name" />
  61. <xsl:template match="/root">
  62. <xts:sequence>
  63. <xts:append select="/root">
  64. <trackingInfo>
  65. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','m_tracking'))), true())" disable-output-escaping="yes"/>
  66. </trackingInfo>
  67. <xsl:if test="key('env-param','ui.conversation')">
  68. <PRconversation>
  69. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','ui.conversation'))), true())" disable-output-escaping="yes"/>
  70. </PRconversation>
  71. </xsl:if>
  72. </xts:append>
  73. </xts:sequence>
  74. </xsl:template>
  75. </xsl:stylesheet>
  76. </xts:block>
  77. <xts:block id="getPromptValues" type="exec" mode="interpret" processor="XSLT" dependency="prependDocument" condition=".[not(/root/env/param[@name = 'doWait'])]" mandatory="false">
  78. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  79. <xts:logicsheet path="logicsheets/portal.xsl"/>
  80. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  81. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  82. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  83. exclude-result-prefixes="pf xsl xsi xtsext">
  84. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  85. <xsl:key name="env-param" match="/root/env/param" use="@name" />
  86. <xsl:template match="/root">
  87. <xts:sequence>
  88. <xts:append>
  89. <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/reportService/202004/.high" responseEnvelope="false" outputHeader="true">
  90. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  91. xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  92. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  93. <SOAP-ENV:Header>
  94. <bus:biBusHeader xsi:type="bus:biBusHeader">
  95. <xsl:choose>
  96. <xsl:when test="key('env-param','m_tracking')!=''">
  97. <!-- use the round-tripped tracking information -->
  98. <xsl:choose>
  99. <xsl:when test="not(trackingInfo/*[local-name()='tracking'])">
  100. <bus:tracking>
  101. <xsl:copy-of select="trackingInfo/*"/>
  102. </bus:tracking>
  103. </xsl:when>
  104. <xsl:otherwise>
  105. <xsl:copy-of select="trackingInfo/*"/>
  106. </xsl:otherwise>
  107. </xsl:choose>
  108. <xsl:apply-templates select="header/*[local-name()='biBusHeader']/*[local-name()!='tracking']"/>
  109. </xsl:when>
  110. <xsl:otherwise>
  111. <xsl:apply-templates select="header/*[local-name()='biBusHeader']/*"/>
  112. </xsl:otherwise>
  113. </xsl:choose>
  114. </bus:biBusHeader>
  115. </SOAP-ENV:Header>
  116. <SOAP-ENV:Body>
  117. <getPromptValues xmlns="http://developer.cognos.com/schemas/reportService/1">
  118. <xsl:choose>
  119. <xsl:when test="/root/PRconversation/*[local-name()='primaryRequest']">
  120. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  121. <xsl:copy-of select="/root/PRconversation/*[local-name()='primaryRequest']/*"/>
  122. </bus:conversation>
  123. </xsl:when>
  124. <xsl:when test="/root/PRconversation/*">
  125. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  126. <xsl:copy-of select="/root/PRconversation/*"/>
  127. </bus:conversation>
  128. </xsl:when>
  129. <xsl:otherwise>
  130. <bus:conversation xsi:type="bus:asynchRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:nil="true"/>
  131. </xsl:otherwise>
  132. </xsl:choose>
  133. <xsl:call-template name="getParameters"/>
  134. <options xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:option[]">
  135. <item xsi:type="bus:runOptionInt">
  136. <bus:name xsi:type="bus:runOptionEnum">skipValueCount</bus:name>
  137. <bus:value xsi:type="xsd:int"><xsl:value-of select="key('env-param','skipValueCount')"/></bus:value>
  138. </item>
  139. <item xsi:type="bus:runOptionInt">
  140. <bus:name xsi:type="bus:runOptionEnum">maximumValueCount</bus:name>
  141. <bus:value xsi:type="xsd:int"><xsl:value-of select="key('env-param','maximumValueCount')"/></bus:value>
  142. </item>
  143. <item xsi:type="bus:asynchOptionEncoding">
  144. <bus:name xsi:type="bus:asynchOptionEnum">attachmentEncoding</bus:name>
  145. <bus:value xsi:type="bus:encodingEnum">base64</bus:value>
  146. </item>
  147. <item xsi:type="bus:asynchOptionInt">
  148. <bus:name xsi:type="bus:asynchOptionEnum">primaryWaitThreshold</bus:name>
  149. <bus:value xsi:type="xsd:int">20</bus:value>
  150. </item>
  151. </options>
  152. </getPromptValues>
  153. </SOAP-ENV:Body>
  154. </SOAP-ENV:Envelope>
  155. </xts:request>
  156. </xts:append>
  157. </xts:sequence>
  158. </xsl:template>
  159. <pf:serialize-xml/>
  160. <!-- don't include superfluous fields in Envelope -->
  161. <xsl:template match="*[local-name()='formFieldVars']/item[name='ui.spec' or name='ui.conversation' or name='previousReportSession']"/>
  162. <!-- used to copy the bus header stuff - see "apply-templates" above. -->
  163. <xsl:template match="*">
  164. <xsl:copy>
  165. <xsl:copy-of select="@*"/>
  166. <xsl:apply-templates/>
  167. </xsl:copy>
  168. </xsl:template>
  169. <xsl:template name="getParameters" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
  170. <parameterValues xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parameterValue[]">
  171. <item xsi:type="bus:parameterValue">
  172. <bus:name xsi:type="xs:string">
  173. <xsl:value-of select="key('env-param','paramName')"/>
  174. </bus:name>
  175. <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parmValueItem[]">
  176. <xsl:choose>
  177. <xsl:when test="key('env-param','displayValue') and key('env-param','useValue')">
  178. <item xsi:type="bus:hierarchicalParmValueItem">
  179. <bus:inclusive xsi:nil="true" xsi:type="xs:boolean"/>
  180. <bus:value xsi:type="bus:simpleParmValueItem">
  181. <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
  182. <bus:display xsi:type="xs:string">
  183. <xsl:value-of select="key('env-param','displayValue')" />
  184. </bus:display>
  185. <bus:use xsi:type="xs:string">
  186. <xsl:value-of select="key('env-param','useValue')" />
  187. </bus:use>
  188. </bus:value>
  189. <bus:subNodes SOAP-ENC:arrayType="bus:hierarchicalParmValueItem[]" xsi:type="SOAP-ENC:Array"/>
  190. </item>
  191. </xsl:when>
  192. </xsl:choose>
  193. </bus:value>
  194. </item>
  195. <xsl:for-each select="/root/env/param[starts-with(@name, 'p_')]">
  196. <item xsi:type="bus:parameterValue">
  197. <bus:name xsi:type="xs:string">
  198. <xsl:value-of select="substring(@name,3)"/>
  199. </bus:name>
  200. <bus:value xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:parmValueItem[]">
  201. <item xsi:type="bus:simpleParmValueItem">
  202. <bus:inclusive xsi:type="xs:boolean">true</bus:inclusive>
  203. <bus:use xsi:type="xs:string">
  204. <xsl:value-of select="key('env-param', @name)" />
  205. </bus:use>
  206. <bus:display xsi:type="xsd:string" xsi:nil="true"/>
  207. </item>
  208. </bus:value>
  209. </item>
  210. </xsl:for-each>
  211. </parameterValues>
  212. </xsl:template>
  213. </xsl:stylesheet>
  214. </xts:block>
  215. <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="getPromptValues wait" condition=".[not(/root/env/param[@name = 'doWait']) or (/root/response/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='waitResponse'])]" mandatory="false">
  216. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  217. <xts:logicsheet path="logicsheets/portal.xsl"/>
  218. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:bus="http://developer.cognos.com/schemas/bibus/3/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xos="http://developer.cognos.com/schemas/xts/output/">
  219. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  220. <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  221. <xsl:template match="/root">
  222. <xts:sequence>
  223. <xts:append select="/root">
  224. <xsl:choose>
  225. <xsl:when test="contains(./*[local-name() = 'getPromptValuesResponse']/*[local-name()='result']/*[local-name()='status'], 'working') or
  226. contains(./*[local-name() = 'getPromptValuesResponse']/*[local-name()='result']/*[local-name()='status'], 'stillWorking') or
  227. contains(./response/*[local-name() = 'Envelope']/*[local-name() = 'Body']/*[local-name() = 'waitResponse']/*[local-name()='result']/*[local-name()='status'], 'stillWorking')">
  228. <working>
  229. <xsl:for-each select="/root/output/*/*/*[local-name() = 'Header']/*[local-name() = 'biBusHeader']/*[local-name() = 'tracking']/*">
  230. <xsl:variable name="markup-track">
  231. <xsl:call-template name="serialize-xml">
  232. <xsl:with-param name="node-set" select="."/>
  233. </xsl:call-template>
  234. </xsl:variable>
  235. <xsl:value-of select="string($markup-track)"/>
  236. </xsl:for-each>
  237. </working>
  238. </xsl:when>
  239. <xsl:otherwise>
  240. <xsl:variable name="output">
  241. <xsl:choose>
  242. <xsl:when test="./response/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='waitResponse']/*[local-name()='result']/*[local-name()='details']/item/*[local-name()='outputPages']/item != ''">
  243. <xsl:value-of select="./response/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='waitResponse']/*[local-name()='result']/*[local-name()='details']/item/*[local-name()='outputPages']/item"/>
  244. </xsl:when>
  245. <xsl:otherwise>
  246. <xsl:value-of select="*[local-name()='getPromptValuesResponse']/*[local-name()='result']/*[local-name()='details']/*[local-name()='item']/*[local-name()='outputPages']/item"/>
  247. </xsl:otherwise>
  248. </xsl:choose>
  249. </xsl:variable>
  250. <xsl:choose>
  251. <xsl:when test="starts-with($output, '&lt;html')">
  252. <htmlOutput>
  253. <xsl:value-of select="$output"/>
  254. </htmlOutput>
  255. <conversation>
  256. <xsl:call-template name="serialize-xml">
  257. <xsl:with-param name="node-set" select="/root//*[local-name()='getPromptValuesResponse']/*[local-name()='result']/*[local-name()='primaryRequest']/*"/>
  258. </xsl:call-template>
  259. </conversation>
  260. <tracking>
  261. <xsl:for-each select="/root/output/*/*/*[local-name() = 'Header']/*[local-name() = 'biBusHeader']/*[local-name() = 'tracking']/*">
  262. <xsl:variable name="markup-track">
  263. <xsl:call-template name="serialize-xml">
  264. <xsl:with-param name="node-set" select="."/>
  265. </xsl:call-template>
  266. </xsl:variable>
  267. <xsl:value-of select="string($markup-track)"/>
  268. </xsl:for-each>
  269. </tracking>
  270. </xsl:when>
  271. <xsl:otherwise>
  272. <promptTree>
  273. <xsl:value-of select="$output" disable-output-escaping="yes"/>
  274. </promptTree>
  275. </xsl:otherwise>
  276. </xsl:choose>
  277. </xsl:otherwise>
  278. </xsl:choose>
  279. </xts:append>
  280. </xts:sequence>
  281. </xsl:template>
  282. <pf:serialize-xml/>
  283. </xsl:stylesheet>
  284. </xts:block>
  285. <xts:block id="format" mode="output" processor="XSLT" type="exec" mimeType="text/html" dependency="appendDocument" mandatory="false">
  286. <xts:logicsheet path="logicsheets/portal.xsl"/>
  287. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" version="1.0">
  288. <xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
  289. <pf:variables/>
  290. <xsl:template match="/root"><xsl:text/>
  291. <xsl:variable name="passport">
  292. <xsl:choose>
  293. <!-- pull the passport out of the bus header -->
  294. <xsl:when test="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']">
  295. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() = 'CAM']/*[local-name = 'CAMPassport']/*[local-name() = 'id']"/>
  296. </xsl:when>
  297. <!-- if it's not there, see if it is still in the cookie -->
  298. <xsl:otherwise>
  299. <xsl:value-of select="xtsext:camcookie_action('getPassportID', $CAMPassportCookie)"/>
  300. </xsl:otherwise>
  301. </xsl:choose>
  302. </xsl:variable>
  303. <xsl:choose>
  304. <xsl:when test="./working">
  305. <xsl:text/>"working","<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='treeNodeName']))"/>","<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(./working), true()))))"/><xsl:text/>
  306. </xsl:when>
  307. <xsl:when test="./htmlOutput">
  308. <xsl:value-of select="./htmlOutput" disable-output-escaping="yes"/>
  309. &lt;script type="text/javascript">
  310. var PT_CONVERSATION_INFO = "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(./conversation), true()))))"/>";
  311. var PT_TRACKING = "<xsl:value-of select="xtsext:javascriptencode(string(xtsext:cafaction(concat('sign_wrap_setpassportid_', $passport), xtsext:web64encode(string(./tracking), true()))))"/>";
  312. &lt;/script>
  313. </xsl:when>
  314. <xsl:otherwise>
  315. <!--
  316. html wrapper
  317. -->
  318. &lt;html>&lt;head>&lt;/head>
  319. &lt;body>
  320. &lt;script type="text/javascript">
  321. <xsl:text/>var j=[<xsl:text/>
  322. <!--
  323. Tree Node Name
  324. -->
  325. <xsl:text/>"<xsl:value-of select="xtsext:javascriptencode(string(/root/env/param[@name='treeNodeName']))"/>"<xsl:text/>
  326. <!--
  327. Handle "more" data
  328. -->
  329. <xsl:choose>
  330. <xsl:when test="/root/promptTree/selectOptions[@moreData='true']">
  331. <xsl:text/>,"true"<xsl:text/>
  332. </xsl:when>
  333. <xsl:otherwise>
  334. <xsl:text/>,"false"<xsl:text/>
  335. </xsl:otherwise>
  336. </xsl:choose>
  337. <!--
  338. Handle skip value
  339. -->
  340. <xsl:choose>
  341. <xsl:when test="/root/promptTree/selectOptions[@skipValueCount]">
  342. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(/root/promptTree/selectOptions/@skipValueCount))"/>"<xsl:text/>
  343. </xsl:when>
  344. <xsl:otherwise>
  345. <xsl:text/>,"0"<xsl:text/>
  346. </xsl:otherwise>
  347. </xsl:choose>
  348. <!--
  349. Handle maximum value
  350. -->
  351. <xsl:choose>
  352. <xsl:when test="/root/promptTree/selectOptions[@maximumValueCount]">
  353. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(/root/promptTree/selectOptions/@maximumValueCount))"/>"<xsl:text/>
  354. </xsl:when>
  355. <xsl:otherwise>
  356. <xsl:text/>,"0"<xsl:text/>
  357. </xsl:otherwise>
  358. </xsl:choose>
  359. <!--
  360. Handle memberDisplayCountDefault value
  361. -->
  362. <xsl:choose>
  363. <xsl:when test="/root/promptTree/selectOptions[@memberDisplayCountDefault]">
  364. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(/root/promptTree/selectOptions/@memberDisplayCountDefault))"/>"<xsl:text/>
  365. </xsl:when>
  366. <xsl:otherwise>
  367. <xsl:text/>,"0"<xsl:text/>
  368. </xsl:otherwise>
  369. </xsl:choose>
  370. <!--
  371. Handle memberDisplayCountLimit value
  372. -->
  373. <xsl:choose>
  374. <xsl:when test="/root/promptTree/selectOptions[@memberDisplayCountLimit]">
  375. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(/root/promptTree/selectOptions/@memberDisplayCountLimit))"/>"<xsl:text/>
  376. </xsl:when>
  377. <xsl:otherwise>
  378. <xsl:text/>,"0"<xsl:text/>
  379. </xsl:otherwise>
  380. </xsl:choose>
  381. <xsl:for-each select="/root/promptTree/selectOptions/selectTreeOption">
  382. <xsl:choose>
  383. <xsl:when test="count(./*) &gt; 0">
  384. <xsl:text/>,"f"<xsl:text/>
  385. </xsl:when>
  386. <xsl:otherwise>
  387. <xsl:text/>,"l"<xsl:text/>
  388. </xsl:otherwise>
  389. </xsl:choose>
  390. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(./@displayValue))"/>"<xsl:text/>
  391. <xsl:text/>,"<xsl:value-of select="xtsext:javascriptencode(string(./@useValue))"/>"<xsl:text/>
  392. <xsl:variable name="currentUseVal">
  393. <xsl:value-of select="./@useValue"/>
  394. </xsl:variable>
  395. <xsl:variable name="isSelected">
  396. <xsl:for-each select="/root/promptTree/selectChoices/selectTreeOption">
  397. <xsl:variable name="currentPromptUseVal">
  398. <xsl:value-of select="./@useValue"/>
  399. </xsl:variable>
  400. <xsl:if test="$currentUseVal=$currentPromptUseVal">
  401. <xsl:text/>true<xsl:text/>
  402. </xsl:if>
  403. </xsl:for-each>
  404. </xsl:variable>
  405. <xsl:choose>
  406. <xsl:when test="$isSelected='true'">
  407. <xsl:text/>,"t"<xsl:text/>
  408. </xsl:when>
  409. <xsl:otherwise>
  410. <xsl:text/>,"f"<xsl:text/>
  411. </xsl:otherwise>
  412. </xsl:choose>
  413. </xsl:for-each>
  414. <xsl:text/>]<xsl:text/>&lt;/script>
  415. &lt;/body>
  416. &lt;/html>
  417. </xsl:otherwise>
  418. </xsl:choose>
  419. </xsl:template>
  420. </xsl:stylesheet>
  421. </xts:block>
  422. <xts:block id="faultHandler" type="fault" processor="XSLT">
  423. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="xsl">
  424. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  425. <xsl:template match="/">
  426. <soapFault>
  427. <xsl:copy>
  428. <xsl:copy-of select="/root/fault"/>
  429. </xsl:copy>
  430. </soapFault>
  431. </xsl:template>
  432. <xsl:template match="text()"/>
  433. </xsl:stylesheet>
  434. </xts:block>
  435. </xts:morphlet>