<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="../test.css" ?>
<!DOCTYPE html [
	<!ATTLIST section id ID #IMPLIED>
	<!ATTLIST h       id ID #IMPLIED>
	<!ATTLIST div     id ID #IMPLIED>
	<!ATTLIST nl      id ID #IMPLIED>

  <!-- for the model attribute to work -->
  <!ATTLIST xforms:model id ID #IMPLIED>

  <!-- for the bind attribute to work -->
  <!ATTLIST xforms:bind id ID #IMPLIED>

  <!-- for the instance() function to work -->
  <!ATTLIST xforms:instance id ID #IMPLIED>

  <!-- for submit to work -->
  <!ATTLIST xforms:submission id ID #IMPLIED>

  <!-- for setfocus and other events to work -->
  <!ATTLIST xforms:input id ID #IMPLIED>
  <!ATTLIST xforms:secret id ID #IMPLIED>
  <!ATTLIST xforms:textarea id ID #IMPLIED>
  <!ATTLIST xforms:output id ID #IMPLIED>
  <!ATTLIST xforms:upload id ID #IMPLIED>
  <!ATTLIST xforms:range id ID #IMPLIED>
  <!ATTLIST xforms:trigger id ID #IMPLIED>
  <!ATTLIST xforms:submit id ID #IMPLIED>
  <!ATTLIST xforms:select id ID #IMPLIED>
  <!ATTLIST xforms:select1 id ID #IMPLIED>

  <!-- for toggle to work -->
  <!ATTLIST xforms:case id ID #IMPLIED>

  <!-- for repeat stuff to work -->
  <!ATTLIST xforms:repeat id ID #IMPLIED>

  <!-- (also any element with xforms:repeat-* attributes -->
 	<!ATTLIST table      id ID #IMPLIED>
  <!ATTLIST td         id ID #IMPLIED>
]>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
      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"
      xml:lang="en">
  <head>
    <title>Rule 4: Create an instance with multiple Line elements each containing 
    	   children Units, Price, Subtotal. Set the Units and Price of each Line 
	   to mutually distinct positive numbers. Write a bind with 
	   nodeset="Line/Subtotal" and calculate="../Units * ../Price". 
	   Use a repeat to create an output for each Subtotal in the instance. 
	   Ensure that for each node N in the nodeset identified by the bind 
	   element's nodeset attribute, a computed expression is evaluated 
	   with N as the context node and its result appears in the 
	   corresponding output.</title>

    <xforms:model xmlns:test="http://example.org">
        <xforms:instance>
	    <test:Lines>
		  <test:Line>
		      <test:Units>2</test:Units>
		      <test:Price>3</test:Price>
		      <test:Subtotal></test:Subtotal>
		  </test:Line>
		  <test:Line>
		      <test:Units>4</test:Units>
		      <test:Price>5</test:Price>
		      <test:Subtotal></test:Subtotal>
		  </test:Line>
		  <test:Line>
		      <test:Units>6</test:Units>
		      <test:Price>7</test:Price>
		      <test:Subtotal></test:Subtotal>
		  </test:Line>
             </test:Lines>
        </xforms:instance>
	<xforms:bind nodeset="test:Line/test:Subtotal" calculate="../test:Units * ../test:Price"/>
    </xforms:model>

  </head>
  <body>
    <h>Rule 4: Create an instance with multiple Line elements each containing 
    	   children Units, Price, Subtotal. Set the Units and Price of each Line 
	   to mutually distinct positive numbers. Write a bind with 
	   nodeset="Line/Subtotal" and calculate="../Units * ../Price". 
	   Use a repeat to create an output for each Subtotal in the instance. 
	   Ensure that for each node N in the nodeset identified by the bind 
	   element's nodeset attribute, a computed expression is evaluated 
	   with N as the context node and its result appears in the 
	   corresponding output.</h>
    <p>Assertions tested by this test case:</p>
    <nl>
        <li href="!-- TBD: insert URI to assertion here">!-- TBD: insert assertion tested here</li>
    </nl>

    <xforms:repeat nodeset="test:Line" xmlns:test="http://example.org">
	<xforms:output ref="test:Subtotal">
            <xforms:label>Subtotal</xforms:label>
	</xforms:output>
    </xforms:repeat>

  </body>
</html>
