<?xml-stylesheet type="text/xsl" href="/xforms-tests/xsltforms/xsltforms.xsl"?>
<svg xmlns:my="http://commerce.example.com/payment" xmlns:txs="http://sourceforge.net/projects/txs" xmlns="http://www.w3.org/2000/svg" xmlns:req="http://www.agencexml.com/requests" xmlns:default="http://www.w3.org/2000/svg" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:s="http://example.com/survey" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" width="700px" height="600px" viewBox="0 0 700 600">
  <defs>
    <polygon id="bullet" points="-30,-30, -10,-10, -20,10" fill="#007138"/>
    <xforms:model id="form1">
      <xforms:instance id="instance1">
        <s:survey xmlns="http://example.com/survey">
          <s:drink>none</s:drink>
          <s:espressoPrefs>
            <s:numberPerWeek>0</s:numberPerWeek>
            <s:sugar>0</s:sugar>
            <s:lemon>Always</s:lemon>
          </s:espressoPrefs>
        </s:survey>
      </xforms:instance>      
      <xforms:bind nodeset="s:espressoPrefs/s:numberPerWeek" type="xsd:integer"/>      
      <xforms:submission id="submit1" method="post" action="http://www.example.org/surveyhandler"/>      
    </xforms:model>
  </defs>
  <title>Espresso survey</title>
  <desc>Sample SVG and XForms - espresso customer survey</desc>
  <g>
    <text x="50" y="70" font-size="40" font-family="Arial Black, sans-serif" font-weight="900">Customer Survey: Espresso</text>
    <g font-family="Arial, Helvetica, sans-serif" font-size="18">
      <foreignObject x="80" y="150" width="250" height="40">
        <xforms:select1 appearance="minimal" model="form1" ref="s:drink">
          <xforms:label>
            <g transform="translate(80, 140)">
              <use xlink:href="#bullet"/>
              <text>Your usual coffee drink is:</text>
            </g>
          </xforms:label>
          <xforms:item>
            <xforms:label>Rich, dark espresso</xforms:label>
            <xforms:value>espresso</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Creamy cappuccino</xforms:label>
            <xforms:value>cappuccino</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Long, milky latte</xforms:label>
            <xforms:value>latte</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Don't like coffee!</xforms:label>
            <xforms:value>none</xforms:value>
          </xforms:item>
        </xforms:select1>
      </foreignObject>
      <foreignObject x="80" y="240" width="250" height="40">
        <xforms:range model="form1" start="0" end="30" step="5" ref="s:espressoPrefs/s:numberPerWeek">
          <xforms:label>
            <g transform="translate(80, 230)">
              <use xlink:href="#bullet"/>
              <text>Shots of espresso per week:</text>
            </g>
          </xforms:label>
        </xforms:range>
      </foreignObject>
      <foreignObject x="80" y="350" width="250" height="40">
        <xforms:select model="form1" ref="s:espressoPrefs/s:sugar">
          <xforms:label>
            <g transform="translate(80, 340)">
              <use xlink:href="#bullet"/>
              <text>Sugar?</text>
            </g>
          </xforms:label>
          <xforms:item>
            <xforms:label>Yes</xforms:label>
            <xforms:value>X</xforms:value>
          </xforms:item>
        </xforms:select>
      </foreignObject>
      <foreignObject x="80" y="420" width="250" height="90">
        <xforms:select1 appearance="full" model="form1" ref="s:espressoPrefs/s:lemon">
          <xforms:label>
            <g transform="translate(80, 410)">
              <use xlink:href="#bullet"/>
              <text>Lemon?</text>
            </g>
          </xforms:label>
          <xforms:item>
            <xforms:label>Required for the full experience</xforms:label>
            <xforms:value>Always</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Whatever</xforms:label>
            <xforms:value>Indifferent</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Keep that citrus to yourself</xforms:label>
            <xforms:value>Never</xforms:value>
          </xforms:item>
        </xforms:select1>
      </foreignObject>
    </g>
    <use xlink:href="#bullet" x="101" y="64" transform="scale(7,3)"/>
    <foreignObject y="150" x="500" height="60" width="100">
      <xforms:submit model="form1">
        <xforms:label>Send survey</xforms:label>
      </xforms:submit>
    </foreignObject>
    <!--- keep the graphics data out of this example listing -->
    <image xlink:href="espresso.svg" x="400" y="230" width="280" height="270"/>
  </g>
</svg>
