<?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xs:dummy="dummy" xmlns:sample="http://www.agencexml.com/sample">
   <head>
      <title>Getting Selection List Data From the XForms Model</title>
      <xf:model>
         <xf:instance>
            <sample:MyModel>
               <sample:MyCode type="xs:string" />
               <sample:MyCodeList>
                  <sample:Item>
                     <sample:Label>Red</sample:Label>
                     <sample:Value>red</sample:Value>
                  </sample:Item>
                  <sample:Item>
                     <sample:Label>Orange</sample:Label>
                     <sample:Value>orange</sample:Value>
                  </sample:Item>
                  <sample:Item>
                     <sample:Label>Yellow</sample:Label>
                     <sample:Value>yellow</sample:Value>
                  </sample:Item>
                  <sample:Item>
                     <sample:Label>Green</sample:Label>
                     <sample:Value>green</sample:Value>
                  </sample:Item>
                  <sample:Item>
                     <sample:Label>Blue</sample:Label>
                     <sample:Value>blue</sample:Value>
                  </sample:Item>
               </sample:MyCodeList>
            </sample:MyModel>
         </xf:instance>
      </xf:model>
   </head>
   <body>
			<div id="xformControl">
				<span>
					<input type="checkbox" onclick="$('console').style.display = this.checked? 'block' : 'none';"  checked="checked"/> Debug
				</span>
			</div>
      <p>Getting Selection List Data From the XForms Model</p>
      <xf:select1 ref="/sample:MyModel/sample:MyCode" appearance="full" incremental="true">
         <xf:itemset nodeset="/sample:MyModel/sample:MyCodeList/sample:Item">
            <xf:label ref="sample:Label" />
            <xf:value ref="sample:Value" />
         </xf:itemset>
      </xf:select1>
      <br />
       Output: <xf:output ref="/sample:MyModel/sample:MyCode" />
			<div id="console"></div>
   </body>
</html>
