topical media & game development

talk show tell print

basic-xml-19-PizzaOrder.htm / htm



  <?xml version="1.0"?>
  <html 
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xforms="http://www.w3.org/2002/xforms"
   xmlns:xmml="http://www.XMML.com/namespace" >
  <head>
    <object id="FormsPlayer" classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58">
    <b>FormsPlayer has failed to load! Please check your installation.</b>
    <br />
   </object>
   <?import namespace="xforms" implementation="#FormsPlayer"?>
   <title>Using the &lt;xforms:itemset&gt; element.</title>
   
   <xforms:model id="default">
    <xforms:instance >
     <xmml:Pizza xmlns:xmml="http://www.XMML.com/namespace" >
      <xmml:Size></xmml:Size>
      <xmml:Toppings></xmml:Toppings>
     </xmml:Pizza>
    </xforms:instance>
    <xforms:submission id="mySubmit" action="file://c:/BXML/Ch19/PizzaOrder.xml" method="put" />
   </xforms:model>
   
   <xforms:model id="myToppings">
    <xforms:instance>
     <xmml:ToppingsAvailable xmlns:xmml="http://www.XMML.com/namespace" >
      <xmml:ToppingAvailable type="Choc">
       <xmml:Description>Chocolate</xmml:Description>
      </xmml:ToppingAvailable>
      <xmml:ToppingAvailable type="Pepp">
       <xmml:Description>Pepperoni</xmml:Description>
      </xmml:ToppingAvailable>
      <xmml:ToppingAvailable type="HamnPin">
       <xmml:Description>Ham and Pineapple</xmml:Description>
      </xmml:ToppingAvailable>
      <xmml:ToppingAvailable type="Chil">
       <xmml:Description>Chilli Beef</xmml:Description>
      </xmml:ToppingAvailable>
     </xmml:ToppingsAvailable>
    </xforms:instance>
   </xforms:model>
   
   <xforms:model id="mySizes">
    <xforms:instance>
     <xmml:SizesAvailable xmlns:xmml="http://www.XMML.com/namespace">
      <xmml:SizeAvailable type="S">
       <xmml:Description>Small</xmml:Description>
      </xmml:SizeAvailable>
      <xmml:SizeAvailable type="M">
       <xmml:Description>Medium</xmml:Description>
      </xmml:SizeAvailable>  
      <xmml:SizeAvailable type="L">
       <xmml:Description>Large</xmml:Description>
      </xmml:SizeAvailable>
     </xmml:SizesAvailable>
    </xforms:instance>
   </xforms:model>
  </head>
  <body>
  <p>Choose the size and toppings for your pizza.</p>
  <xforms:select1 model="default" ref="/xmml:Pizza/xmml:Size" >
   <xforms:label>Sizes offered.</xforms:label>
   <xforms:itemset model="mySizes" nodeset="/xmml:SizesAvailable/xmml:SizeAvailable" >
    <xforms:label ref="xmml:Description/text()" />
    <xforms:value ref="xmml:Description/text()" />
   </xforms:itemset>
  </xforms:select1>
  <br />
  <p>Choose your toppings here. You may choose up to two toppings.</p>
   <xforms:select model="default" ref="/xmml:Pizza/xmml:Toppings" >
    <xforms:label>There are four toppings to choose from.</xforms:label>
    <xforms:itemset model="myToppings" nodeset="/xmml:ToppingsAvailable/xmml:ToppingAvailable" >
     <xforms:label ref="xmml:Description" />
     <xforms:value ref="xmml:Description" />
    </xforms:itemset>
   </xforms:select>
  <br /><br />
  <xforms:submit submission="mySubmit">
   <xforms:label>Click Here to submit your Order.</xforms:label>
  </xforms:submit>
  </body>
  </html>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.