render.xsl 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0"
  9. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  10. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  12. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  13. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  14. xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
  15. exclude-result-prefixes="xsl xsi xos xts bus xtsext">
  16. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  17. <!-- general -->
  18. <xsl:variable name="webcontent" select="/fault/settings/param[@name='webcontent']"/>
  19. <xsl:variable name="app" select="/fault/settings/param[@name='app']"/>
  20. <xsl:variable name="skin" select="/fault/settings/param[@name='skin']"/>
  21. <xsl:variable name="web" select="/fault/settings/param[@name='web']"/>
  22. <xsl:variable name="gateway" select="/fault/settings/param[@name='gateway']"/>
  23. <xsl:variable name="pathInfo" select="/fault/settings/param[@name='pathInfo']"/>
  24. <xsl:variable name="browser" select="/fault/settings/param[@name='browser']"/>
  25. <xsl:variable name="skin_images" select="/fault/settings/param[@name='skin_images']"/>
  26. <xsl:variable name="isModal" select="/fault/settings/param[@name='isModal']"/>
  27. <xsl:variable name="locale" select="/fault/settings/param[@name='locale']"/>
  28. <!-- custom login -->
  29. <xsl:variable name="custom-auth" select="/fault/settings/param[@name='custom-auth']"/>
  30. <xsl:variable name="isLoginCustomizationEnabled" select="/fault/login and $custom-auth/logon[@enabled = 'true']"/>
  31. <xsl:variable name="referenceableIds">
  32. <layout>
  33. <entry name="header">CL_HEADER</entry>
  34. <entry name="prompt">CL_PROMPT</entry>
  35. <entry name="footer">CL_FOOTER</entry>
  36. </layout>
  37. <prompts>
  38. <entry name="CAMNamespace">CL_PROMPT_namespace</entry>
  39. <entry name="CAMNamespaceDisplayName">CL_PROMPT_namespace</entry>
  40. <entry name="CAMUsername">CL_PROMPT_username</entry>
  41. <entry name="CAMPassword">CL_PROMPT_password</entry>
  42. <entry name="CAMUserNameForDisplay">CL_PROMPT_username</entry>
  43. <entry name="CAMOldPassword">CL_PROMPT_oldPassword</entry>
  44. <entry name="CAMNewPassword">CL_PROMPT_newPassword</entry>
  45. <entry name="CAMNewPassword2">CL_PROMPT_newPasswordConfirm</entry>
  46. </prompts>
  47. <captions>
  48. <entry name="general">CL_PROMPT_general_caption</entry>
  49. <entry name="selectNamespace">CL_PROMPT_selectNamespace_caption</entry>
  50. <entry name="enterCredentials">CL_PROMPT_enterCredentials_caption</entry>
  51. <entry name="badCredentialsEntered">CL_PROMPT_badCredentialsEntered_caption</entry>
  52. <entry name="passwordExpiry">CL_PROMPT_passwordExpiry_caption</entry>
  53. </captions>
  54. </xsl:variable>
  55. <xsl:template match="/">
  56. <xsl:choose>
  57. <xsl:when test="fault/settings/param[@name='redirect'] != ''">
  58. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
  59. <html lang="{$locale}">
  60. <head>
  61. <title><xsl:value-of select="fault/presentation/browserTitle"/></title>
  62. <meta http-equiv="expires" content="0"/>
  63. <script language="javascript">
  64. window.location.href = "<xsl:value-of select="xtsext:javascriptencode(fault/settings/param[@name='redirect'])"/>";
  65. </script>
  66. </head>
  67. </html>
  68. </xsl:when>
  69. <xsl:otherwise>
  70. <html lang="{$locale}">
  71. <head>
  72. <meta http-equiv="expires" content="0"/>
  73. <link rel="stylesheet" type="text/css" href="{$webcontent}/login/styles.css"/>
  74. <xsl:if test="not($isLoginCustomizationEnabled)">
  75. <link rel="stylesheet" type="text/css" href="{$webcontent}/login/ibm.css"/>
  76. </xsl:if>
  77. <!-- Copy over the helper scripts and any associated form(s) -->
  78. <xsl:apply-templates select="fault/presentation/scripts/*" mode="scripts-and-form"/>
  79. <script language="JavaScript">
  80. if (document.addEventListener) {
  81. window.addEventListener("beforeunload", function(){}, false);
  82. } else if (document.attachEvent) {
  83. window.attachEvent("onbeforeunload", function(){});
  84. }
  85. </script>
  86. <title><xsl:value-of select="fault/presentation/browserTitle"/></title>
  87. </head>
  88. <body role="main" onload="if (typeof handleCustomization == 'function') handleCustomization(); if (window.init) init();">
  89. <form style="margin:0px;padding:0px;" method="post" action="{concat($gateway,$pathInfo)}" name="pform">
  90. <xsl:call-template name="render"/>
  91. </form>
  92. </body>
  93. </html>
  94. </xsl:otherwise>
  95. </xsl:choose>
  96. </xsl:template>
  97. <xsl:template name="render">
  98. <xsl:choose>
  99. <xsl:when test="$isLoginCustomizationEnabled">
  100. <div id="{$referenceableIds/layout/entry[@name='header']}" style="display:none">
  101. <xsl:call-template name="renderHeader"/>
  102. </div>
  103. <div id="{$referenceableIds/layout/entry[@name='prompt']}" style="display:none">
  104. <xsl:call-template name="renderPrompt"/>
  105. </div>
  106. <div id="{$referenceableIds/layout/entry[@name='footer']}" style="display:none">
  107. <xsl:call-template name="renderFooter"/>
  108. </div>
  109. <!-- Perform customization to the login page -->
  110. <xsl:call-template name="doAuthCustomization"/>
  111. </xsl:when>
  112. <xsl:otherwise>
  113. <div id="loginBoxWithShadow" cellpadding="0" cellspacing="0" border="0">
  114. <div id="loginBox">
  115. <div id="loginBoxInner">
  116. <xsl:call-template name="renderHeader"/>
  117. <table class="loginBody" width="100%" cellspacing="0" cellpadding="1" role="presentation">
  118. <tbody>
  119. <tr>
  120. <td width="35%">
  121. <div id="loginIcon"/>
  122. </td>
  123. <td>
  124. <xsl:call-template name="renderPrompt"/>
  125. <xsl:call-template name="renderFooter"/>
  126. </td>
  127. <td width="5%">
  128. </td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <xsl:if test="fault[login]">
  133. <table class="loginFooter" width="100%" cellspacing="0" cellpadding="1" role="presentation">
  134. <tbody>
  135. <tr>
  136. <td>
  137. <div id="ibmLogo"/>
  138. </td>
  139. <td>
  140. <div class="loginCopyright" id="loginCopyright">
  141. <xsl:value-of select="fault/presentation/resources/message[@id='IDS_PROPERTY_IBM']"/><br/>
  142. <xsl:value-of select="fault/presentation/resources/message[@id='IDS_COPYRIGHT']"/><br/>
  143. <xsl:value-of select="fault/presentation/resources/message[@id='IDS_TRADEMARK']"/>
  144. </div>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>
  149. </xsl:if>
  150. </div>
  151. </div>
  152. </div>
  153. </xsl:otherwise>
  154. </xsl:choose>
  155. </xsl:template>
  156. <xsl:template name="renderHeader">
  157. <!-- ******************* -->
  158. <!-- Generate the header -->
  159. <!-- ******************* -->
  160. <table border="0" width="100%" cellspacing="0" cellpadding="0" class="loginHeader" role="presentation">
  161. <tr>
  162. <td width="100%"></td>
  163. <xsl:if test="fault/presentation/actions/action[@type='help']">
  164. <td class="loginHeaderLink" nowrap="nowrap">
  165. <a href="javascript:{fault/presentation/actions/action[@type='help']/default-command}" class="loginHeaderLinkAnchor" role="button" wairole="button" id="logonHelp">
  166. <xsl:attribute name="onkeypress">if(event.keyCode==9)return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) <xsl:value-of select="fault/presentation/actions/action[@type='help']/default-command"/>; return false;</xsl:attribute>
  167. <xsl:value-of select="fault/presentation/actions/action[@type='help']/label"/>
  168. </a>
  169. </td>
  170. </xsl:if>
  171. <xsl:if test="fault/presentation/actions/action[@type='close']">
  172. <td class="loginHeaderLink loginClose">
  173. <div class="loginHeaderCloseIcon">
  174. <a href="javascript:{fault/presentation/actions/action[@type='close']/default-command}" class="loginHeaderLinkAnchor" role="button" wairole="button" >
  175. <xsl:attribute name="onkeypress">if(event.keyCode==9)return true; else if (event.keyCode==13 || event.keyCode==32 || event.charCode==32) <xsl:value-of select="fault/presentation/actions/action[@type='close']/default-command"/>; return false;</xsl:attribute>
  176. <xsl:attribute name="title">
  177. <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
  178. </xsl:attribute>
  179. <img height="28" width="28" vspace="2" border="0"
  180. src="{$skin_images}popup_close_28.png" role="button">
  181. <xsl:attribute name="alt">
  182. <xsl:value-of select="fault/presentation/actions/action[@type='close']/label"/>
  183. </xsl:attribute>
  184. </img>
  185. </a>
  186. </div>
  187. </td>
  188. </xsl:if>
  189. </tr>
  190. </table>
  191. </xsl:template>
  192. <xsl:template name="renderPrompt">
  193. <!-- ******************* -->
  194. <!-- Generate the prompt body -->
  195. <!-- ******************* -->
  196. <xsl:apply-templates/>
  197. </xsl:template>
  198. <xsl:template name="renderFooter">
  199. <!-- ******************* -->
  200. <!-- Generate the footer -->
  201. <!-- ******************* -->
  202. <table class="loginFooter" width="100%" cellpadding="1" cellspacing="0" role="presentation">
  203. <tr>
  204. <xsl:if test="fault/presentation/actions/action[@type='ok']">
  205. <td>
  206. <input id="cmdOK"
  207. type="submit" class="loginFooterButton" onmouseover="this.className='loginFooterButtonOver'"
  208. onmouseout="this.className='loginFooterButton'"
  209. value="{fault/presentation/actions/action[@type='ok']/label}"
  210. onclick="javascript:{fault/presentation/actions/action[@type='ok']/default-command}; return false;"/>
  211. </td>
  212. </xsl:if>
  213. <xsl:if test="fault/presentation/actions/action[@type='cancel']">
  214. <td>
  215. <input id="cmdCancel"
  216. type="button" class="loginFooterButton"
  217. onmouseover="this.className='loginFooterButtonOver'"
  218. onmouseout="this.className='loginFooterButton'"
  219. value="{fault/presentation/actions/action[@type='cancel']/label}"
  220. onclick="javascript:{fault/presentation/actions/action[@type='cancel']/default-command}; return false;">
  221. <xsl:attribute name="onkeypress">javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("logonHelp")) <xsl:text>{</xsl:text>document.getElementById("logonHelp").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;</xsl:attribute>
  222. </input>
  223. </td>
  224. </xsl:if>
  225. <xsl:if test="fault/presentation/actions/action[@type='yes']">
  226. <td>
  227. <input id="cmdYes"
  228. type="submit" class="loginFooterButton" onmouseover="this.className='loginFooterButtonOver'"
  229. onmouseout="this.className='loginFooterButton'"
  230. value="{fault/presentation/actions/action[@type='yes']/label}"
  231. onclick="javascript:{fault/presentation/actions/action[@type='yes']/default-command}; return false;" role="button" wairole="button"/>
  232. </td>
  233. </xsl:if>
  234. <xsl:if test="fault/presentation/actions/action[@type='no']">
  235. <td>
  236. <input id="cmdNo"
  237. type="button" class="loginFooterButton"
  238. onmouseover="this.className='loginFooterButtonOver'"
  239. onmouseout="this.className='loginFooterButton'"
  240. value="{fault/presentation/actions/action[@type='no']/label}"
  241. onclick="javascript:{fault/presentation/actions/action[@type='no']/default-command}; return false;" role="button" wairole="button">
  242. <xsl:attribute name="onkeypress">
  243. javascript:if(event.keyCode==9) <xsl:text>{</xsl:text> if(event.shiftKey==true) return true; else <xsl:text>{</xsl:text> if(document.getElementById("logonHelp")) <xsl:text>{</xsl:text>document.getElementById("logonHelp").focus(); return false; <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> <xsl:text>}</xsl:text> return true;
  244. </xsl:attribute>
  245. </input>
  246. </td>
  247. </xsl:if>
  248. <td width="100%"/>
  249. </tr>
  250. </table>
  251. </xsl:template>
  252. <!-- custom login -->
  253. <xsl:template name="clTranslateName">
  254. <xsl:variable name="promptTable" select="$referenceableIds/prompts"/>
  255. <xsl:if test="./*[local-name() = 'type'] != 'hidden'">
  256. <xsl:variable name="name">
  257. <xsl:value-of select="./*[local-name() = 'name']"/>
  258. <xsl:variable name="multiples" select="count(preceding-sibling::node()[local-name() = 'item' and *[local-name() = 'name'] = current()/*[local-name()='name']]) + 1"/>
  259. <xsl:if test="$multiples &gt; 1">
  260. <xsl:value-of select="$multiples"/>
  261. </xsl:if>
  262. </xsl:variable>
  263. <xsl:variable name="clName">
  264. <xsl:choose>
  265. <xsl:when test="$promptTable/entry[@name=$name]">
  266. <xsl:value-of select="$promptTable/entry[@name=$name]"/>
  267. </xsl:when>
  268. <xsl:otherwise><xsl:value-of select="$name"/></xsl:otherwise>
  269. </xsl:choose>
  270. </xsl:variable>
  271. <xsl:value-of select="$clName"/>
  272. </xsl:if>
  273. </xsl:template>
  274. <xsl:template name="clBuildCaption">
  275. <xsl:param name="promptInfo"/>
  276. <!--
  277. - Please select a namespace for authentication.
  278. - Please type your credentials for authentication.
  279. - A user name was not entered. Please type your credentials for authentication.
  280. - The provided credentials are invalid. Please type your credentials for authentication.
  281. - Your password has expired. Please change it. Please type your credentials for authentication.
  282. - The specified old password is not correct. Your password has expired. Please change it. Please type your credentials for authentication.
  283. -->
  284. <xsl:variable name="messages" select="$promptInfo/../*[local-name() = 'messages']/*[local-name() = 'item']/*[local-name() = 'messageString']"/>
  285. <xsl:variable name="item" select="$promptInfo/*[local-name() = 'displayObjects']/*[local-name() = 'item']"/>
  286. <xsl:variable name="clCaptionTable" select="$referenceableIds/captions"/>
  287. <xsl:choose>
  288. <xsl:when test="$item[*[local-name() = 'name']='CAMNamespace' and *[local-name() = 'type']='singleselect']">
  289. <xsl:value-of select="$clCaptionTable/entry[@name='selectNamespace']"/>
  290. </xsl:when>
  291. <xsl:when test="$item[*[local-name() = 'name']='CAMNewPassword']">
  292. <xsl:value-of select="$clCaptionTable/entry[@name='passwordExpiry']"/>
  293. </xsl:when>
  294. <xsl:when test="$item[*[local-name() = 'name']='CAMNamespace' and *[local-name() = 'type']='hidden']">
  295. <xsl:choose>
  296. <xsl:when test="contains($messages, 'CAM-AAA-')"><xsl:value-of select="$clCaptionTable/entry[@name='badCredentialsEntered']"/></xsl:when>
  297. <xsl:otherwise><xsl:value-of select="$clCaptionTable/entry[@name='enterCredentials']"/></xsl:otherwise>
  298. </xsl:choose>
  299. </xsl:when>
  300. <xsl:otherwise><xsl:value-of select="$clCaptionTable/entry[@name='general']"/></xsl:otherwise>
  301. </xsl:choose>
  302. </xsl:template>
  303. <xsl:template name="doAuthCustomization">
  304. <xsl:if test="$isLoginCustomizationEnabled">
  305. <xsl:variable name="base-template-name" select="$custom-auth/logon/base-template-name"/>
  306. <script language="javascript" src="{$webcontent}/{$app}/js/ajaxutils.js"></script>
  307. <script language="javascript" src="{$webcontent}/{$app}/js/customlogin.js"></script>
  308. <script language="JavaScript">
  309. var cl_templatePath = g_PS_webContent + "/login";
  310. var cl_baseTemplateName = "<xsl:value-of select="xtsext:javascriptencode($base-template-name)"/>";
  311. var cl_templateDefaultExtension = ".xhtml";
  312. var cl_locale = g_PS_locale;
  313. function handleCustomization() {
  314. doCustomization();
  315. }
  316. </script>
  317. <!-- General all supported and referenceable entities for customization -->
  318. <script language="JavaScript">
  319. <!-- Layout entries -->
  320. var clLayoutArray = [
  321. <xsl:variable name="clLayoutTable" select="$referenceableIds/layout"/>
  322. <xsl:for-each select="$clLayoutTable/entry">
  323. <xsl:if test="position() &gt; 1">,</xsl:if>
  324. '<xsl:value-of select="."/>'
  325. </xsl:for-each>
  326. ];
  327. <!-- Message replacement entries -->
  328. var clMessageReplaceArray = [
  329. <!-- Captions -->
  330. <xsl:variable name="clCaptionTable" select="$referenceableIds/captions"/>
  331. <xsl:for-each select="$clCaptionTable/entry">
  332. <xsl:if test="position() &gt; 1">,</xsl:if>
  333. '<xsl:value-of select="."/>'
  334. </xsl:for-each>
  335. <!-- Prompts -->
  336. <xsl:variable name="promptTable" select="$referenceableIds/prompts"/>
  337. <xsl:for-each select="$promptTable/entry">
  338. <xsl:if test="not(preceding-sibling::node()[.=current()/.])">
  339. <xsl:if test="position() &gt; 1 or count($promptTable/entry) &gt; 0">,</xsl:if>
  340. '<xsl:value-of select="."/>_label'
  341. </xsl:if>
  342. </xsl:for-each>
  343. ];
  344. </script>
  345. </xsl:if>
  346. </xsl:template>
  347. <!-- -->
  348. <!-- Render LOGIN fault -->
  349. <!-- -->
  350. <xsl:template match="fault[login]">
  351. <div id="loginInput">
  352. <!-- original request -->
  353. <xsl:apply-templates select="redirect-form/*" mode="scripts-and-form"/>
  354. <div class="loginPrompt">
  355. <xsl:variable name="promptInfo" select="login/*[local-name() = 'CAM']/*[local-name() = 'exception']/*[local-name() = 'promptInfo']"/>
  356. <!-- custom login -->
  357. <xsl:variable name="clCaption">
  358. <xsl:call-template name="clBuildCaption">
  359. <xsl:with-param name="promptInfo" select="$promptInfo"/>
  360. </xsl:call-template>
  361. </xsl:variable>
  362. <div class="loginHeaderTitle" nowrap="nowrap">
  363. <xsl:value-of select="/fault/presentation/title"/>
  364. </div>
  365. <div id="{$clCaption}" class="loginPromptCaption">
  366. <xsl:for-each select="$promptInfo/*[local-name() = 'captions']/*">
  367. <xsl:value-of select="concat(., ' ')"/>
  368. </xsl:for-each>
  369. </div>
  370. <div>
  371. <xsl:for-each select="$promptInfo/*[local-name() = 'displayObjects']/*[local-name() = 'item'][@xsi:type = 'bus:displayObject']">
  372. <!-- custom login -->
  373. <xsl:variable name="clName"><xsl:call-template name="clTranslateName"/></xsl:variable>
  374. <xsl:choose>
  375. <!-- Hidden fields -->
  376. <xsl:when test="*[local-name() = 'type'] = 'hidden'">
  377. <input type="hidden" name="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}"/>
  378. </xsl:when>
  379. <xsl:when test="*[local-name() = 'type'] = 'singleselect'">
  380. <div id="{$clName}_container">
  381. <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:10px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
  382. <div id="{$clName}_input">
  383. <select name="{*[local-name() = 'name']}" id="{*[local-name() = 'name']}" onkeypress="submitThis(event)" aria-labelledby="{$clName}_label">
  384. <xsl:if test="count(preceding-sibling::*/*[local-name() = 'type' and (. = 'singleselect' or .='text' or .= 'textnoecho')]) = 0">
  385. <xsl:attribute name="aria-describedby"><xsl:value-of select="$clCaption"/></xsl:attribute>
  386. </xsl:if>
  387. <xsl:for-each select="*[local-name() = 'promptOptions']/*">
  388. <option value="{*[local-name() = 'id']}">
  389. <xsl:if test="*[local-name() = 'default'] = 'true'">
  390. <xsl:attribute name="selected">selected</xsl:attribute>
  391. </xsl:if>
  392. <xsl:value-of select="*[local-name() = 'value']"/>
  393. </option>
  394. </xsl:for-each>
  395. </select>
  396. <script language="JavaScript">
  397. function submitThis(e)
  398. {
  399. var sKey = null;
  400. if (window.event) //IE, Safari
  401. sKey = window.event.keyCode;
  402. else
  403. sKey = e.which; //Moz
  404. if ((sKey == '13') || (sKey=='32'))
  405. window.document.pform.submit();
  406. }
  407. </script>
  408. </div>
  409. </div>
  410. </xsl:when>
  411. <!-- Static display fields -->
  412. <xsl:when test="*[local-name() = 'type'] = 'display'">
  413. <div id="{$clName}_container">
  414. <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:10px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
  415. <div id="{$clName}_input" class="loginPromptInputStaticText"><xsl:value-of select="*[local-name() = 'value']"/></div>
  416. </div>
  417. </xsl:when>
  418. <!-- Password/Text fields -->
  419. <xsl:otherwise>
  420. <div id="{$clName}_container">
  421. <div id="{$clName}_label" class="loginPromptInputLabel" style="padding-top:5px;"><xsl:value-of select="*[local-name() = 'caption']"/></div>
  422. <div id="{$clName}_input">
  423. <input class="loginPromptInputText" name="{*[local-name() = 'name']}" id="{*[local-name() = 'name']}" value="{*[local-name() = 'value']}" aria-labelledby="{$clName}_label">
  424. <xsl:if test="count(preceding-sibling::*/*[local-name() = 'type' and (. = 'singleselect' or .='text' or .= 'textnoecho')]) = 0 ">
  425. <xsl:attribute name="aria-describedby"><xsl:value-of select="$clCaption"/></xsl:attribute>
  426. </xsl:if>
  427. <xsl:if test="contains(*[local-name() = 'type'], 'textnoecho')">
  428. <xsl:attribute name="type">password</xsl:attribute>
  429. <xsl:attribute name="autocomplete">off</xsl:attribute>
  430. </xsl:if>
  431. <xsl:if test="*[local-name() = 'type']='text'">
  432. <xsl:attribute name="type">text</xsl:attribute>
  433. </xsl:if>
  434. </input>
  435. </div>
  436. </div>
  437. </xsl:otherwise>
  438. </xsl:choose>
  439. </xsl:for-each>
  440. </div>
  441. </div>
  442. </div>
  443. </xsl:template>
  444. <xsl:template match="*" mode="scripts-and-form">
  445. <xsl:copy>
  446. <xsl:copy-of select="@*"/>
  447. <xsl:apply-templates mode="scripts-and-form"/>
  448. </xsl:copy>
  449. </xsl:template>
  450. <xsl:template match="input" mode="scripts-and-form">
  451. <xsl:copy>
  452. <xsl:copy-of select="@*"/>
  453. <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
  454. </xsl:copy>
  455. </xsl:template>
  456. <xsl:template match="text()"/>
  457. </xsl:stylesheet>