<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="../xhtml2.css" ?>
<!DOCTYPE html [
        <!ATTLIST section id ID #IMPLIED>
        <!ATTLIST h       id ID #IMPLIED>
        <!ATTLIST div     id ID #IMPLIED>
        <!ATTLIST nl      id ID #IMPLIED>
]>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:foreign="http://example.com/2003/foreign"
      xml:lang="en">
  <head>
    <title>Test case for assertion 2.</title>
    <xforms:model id="m_001" foreign:test="foreignAttribute">
        <xforms:instance id="i_001" xmlns="" foreign:test="foreignAttribute">
                <r>
                    <a></a>
                    <b/>
                    <lines>
                      <line name="a">
                        <price>3.00</price>
                      </line>
                      <line name="b">
                        <price>32.25</price>
                      </line>
                      <line name="c">
                        <price>132.99</price>
                      </line>
                    </lines>
                    <yourname/>
                </r>
        </xforms:instance>
        <xforms:submission id="s1" action="http://example.com/2003/foreignTest" foreign:test="foreignAttribute"/>
        <xforms:bind id="bind1" ref="/r/a" foreign:test="foreignAttribute"/>
    </xforms:model>
  </head>
  <body>
    <xforms:group>
      <xforms:label foreign:test="foreignAttribute">If it displays, foreign Namespace attributes work ok.</xforms:label>
      <!-- Form Controls -->
      <xforms:group foreign:test="foreignAttribute">
        <xforms:input ref="a" foreign:test="foreignAttribute">
          <xforms:label foreign:test="foreignAttribute">Input:</xforms:label>
          <xforms:help foreign:test="foreignAttribute">Example Help</xforms:help>
          <xforms:hint foreign:test="foreignAttribute">Example Hint</xforms:hint>
          <xforms:alert foreign:test="foreignAttribute">Example Alert</xforms:alert>
        </xforms:input>
        <xforms:secret ref="a" foreign:test="foreignAttribute">
          <xforms:label>Secret:</xforms:label>
        </xforms:secret>
        <xforms:textarea ref="a" foreign:test="foreignAttribute">
          <xforms:label>Textarea:</xforms:label>
        </xforms:textarea>
        <xforms:output ref="a" foreign:test="foreignAttribute">
          <xforms:label>output:</xforms:label>
        </xforms:output>
        <xforms:upload ref="a" foreign:test="foreignAttribute">
          <xforms:label>upload:</xforms:label>
          <xforms:filename foreign:test="foreignAttribute">example.xml</xforms:filename>
          <xforms:mediatype foreign:test="foreignAttribute">application.xml</xforms:mediatype>
        </xforms:upload>
        <xforms:range ref="a" foreign:test="foreignAttribute">
          <xforms:label>range:</xforms:label>
        </xforms:range>
        <xforms:trigger foreign:test="foreignAttribute">
          <xforms:label>Trigger</xforms:label>
        </xforms:trigger>
        <xforms:submit ref="a" submission="s1" foreign:test="foreignAttribute">
          <xforms:label>Submit</xforms:label>
        </xforms:submit>
        <xforms:select1 bind="bind1" foreign:test="foreignAttribute">
          <xforms:label>Select1:</xforms:label>
          <xforms:item foreign:test="foreignAttribute">
            <xforms:label>Two</xforms:label>
            <xforms:value foreign:test="foreignAttribute">2</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Three</xforms:label>
            <xforms:value>3</xforms:value>
          </xforms:item>
          <xforms:choices foreign:test="foreignAttribute">
            <xforms:item>
              <xforms:label>Three an a half</xforms:label>
              <xforms:value>3.5</xforms:value>
            </xforms:item>
            <xforms:item>
              <xforms:label>Three and three quarters</xforms:label>
              <xforms:value>3.75</xforms:value>
            </xforms:item>
          </xforms:choices>
        </xforms:select1>
        <xforms:select ref="a" foreign:test="foreignAttribute">
          <xforms:label>Select:</xforms:label>
          <xforms:item>
            <xforms:label>Two</xforms:label>
            <xforms:value>2</xforms:value>
          </xforms:item>
          <xforms:item>
            <xforms:label>Three</xforms:label>
            <xforms:value>3</xforms:value>
          </xforms:item>
        </xforms:select>
      </xforms:group>
      <!-- Switch Module -->
      <xforms:group>
        <xforms:switch foreign:test="foreignAttribute">
          <xforms:case id="in" selected="true" foreign:test="foreignAttribute">
            <xforms:input ref="yourname">
              <xforms:label>Please tell me your name</xforms:label>
              <xforms:toggle ev:event="xforms-activate" case="out"/>
            </xforms:input>
          </xforms:case>
          <xforms:case id="out" selected="false">
            <html:p>Hello
              <xforms:output ref="yourname" />.
              <xforms:trigger id="editButton">
                <xforms:label>Edit</xforms:label>
                <xforms:toggle ev:event="xforms-activate" case="in"/>
              </xforms:trigger>
            </html:p>
          </xforms:case>
        </xforms:switch>
      </xforms:group>
      <!-- Repeat Module -->
      <xforms:group>
        <xforms:repeat id="lineset" nodeset="/r/lines/line" foreign:test="foreignAttribute">
          <xforms:input ref="price">
            <xforms:label>Line Item</xforms:label>
          </xforms:input>
          <xforms:input ref="@name">
            <xforms:label>Name</xforms:label>
          </xforms:input>
        </xforms:repeat>
        <xforms:trigger>
          <xforms:label>Insert a new item after the current one</xforms:label>
          <xforms:action ev:event="xforms-activate">
            <xforms:insert nodeset="/r/lines/line" at="index('lineset')" position="after" foreign:test="foreignAttribute"/>
            <xforms:setvalue ref="/r/lines/line[index('lineset')]/@name" foreign:test="foreignAttribute"/>
            <xforms:setvalue ref="/r/lines/line[index('lineset')]/price">0.00</xforms:setvalue>
          </xforms:action>
        </xforms:trigger>
        <xforms:trigger>
          <xforms:label>remove current item</xforms:label>
          <xforms:delete ev:event="activate" nodeset="/r/lines/line" at="index('lineset')" foreign:test="foreignAttribute"/>
        </xforms:trigger>
      </xforms:group>
    </xforms:group>
  </body>
</html>
