midrange.com code scratchpad
Name:
Running SQL Template
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
03/22/2011 10:38:19 pm
IP:
Logged
Description:
Running SQL to build a list in HTML
Code:
  1. <xmli:template xmlns:xmli="http://www.sourceforge.net/xmli"
  2.                xmlns:cgi="http://www.larryducie.com/cgi"
  3.                ccsid="819" format="pretty" >
  4.  
  5.  
  6. <html>
  7.     <head>
  8.     <title>Active Jobs</title>
  9.     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
  10.     <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
  11.     <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
  12. </head>
  13. <body>
  14.  
  15. <div data-role="page" id="Queued" data-theme="b">
  16.  
  17.     <div data-role="header" data-theme="b">
  18.         <h1>XMLi Sample Orders</h1>
  19.     </div><!-- /header -->
  20.  
  21.     <div data-role="content">
  22.  
  23.         <ul data-role="listview">
  24.         
  25.         <!-- Run SQL to get a list of Orders by order number (sql-naming is set to SQL) -->
  26.         <xmli:run-sql name="orders" statement="select ordordno, orddat, ordtot, ordcus
  27.                                                from xmlilib.xmliorders
  28.                                                order by ordordno">
  29.         </xmli:run-sql>
  30.         <xmli:for-each>
  31.                 <li><a href="${'/templates/queue_entries.html?order=' + orders.1}"><xmli:value-of select="orders.1" /></a> <span class="ui-li-count">$<xmli:value-of select="orders.3" /></span></li>
  32.         </xmli:for-each>
  33.             
  34.         </ul>
  35.     </div><!-- /content -->
  36.     
  37.     <div data-role="controlgroup" data-type="horizontal">
  38.                 <a href="answer.html?answer=yes" data-role="button">Yes</a>
  39.                 <a href="answer.html?answer=no" data-role="button">No</a>
  40.                 <a href="answer.html?answer=maybe" data-role="button">Maybe</a>
  41.         </div>
  42.  
  43.     
  44. </div><!-- /page -->
  45.  
  46. </body>
  47.  
  48. </html>
  49.  
  50. </xmli:template>
  51.  
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css