<?xml version="1.0" encoding="us-ascii"?>
<?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/2002/06/xhtml2" lang="en">
<head>
<title>Chapter 7: XPath</title></head>
<body>
<h>Chapter 7: XPath</h>
<section class="chapter" number="7">
<section class="assertion">
<h href="index-all.html#expr" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7. XPath Expressions in XForms</h>
<p class="MUST UA">XPath expressions MUST be syntactically valid, and syntactically  invalid XPath expression MUST dispatch an exception. </p>
<nl>
<li href="chapter7/7-1.xml">Test that invalid binding expression from an  input control to an instance node dispatches  an xforms-binding-exception</li>
<li href="chapter7/7-2.xml">Test that use of an undefined function in a  binding expression from an input control to an   instance node dispatches an xforms-binding-exception</li>
<li href="chapter7/7-3.xml">Test that invalid calculate expression in a  bind element dispatches an xforms-compute-exception</li>
<li href="chapter7/7-4.xml">Test that use of an undefined function in a  calculate expression in a bind element dispatches an   xforms-compute-exception</li></nl></section>
<section class="assertion">
<h href="index-all.html#expr-instance" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.2 Instance Data</h>
<p class="MUST UA">If the XForms processor implements DOM, then it must provide  DOM access to instance data as defined by the IDL interface  XFormsModelElement. </p>
<nl>
<li href="chapter7/7.2-1.xml">In an XForms model with an instance identified by  
<code>foo</code>, test that getInstanceDocument(&quot;foo&quot;)  returns a DOM document and that getInstanceDocument(&quot;bar&quot;)  throws a DOMException.</li>
<li href="chapter7/7.2-2.xml">
<ul>
<li>Create an instance with element E having three  child elements, each tagged F with starting value of 1.</li>
<li>Let the model declare a bind that specifies a calculate  for each child of E, setting it equal to 1 more than  the preceding sibling, or 1 if there is no preceding sibling.</li>
<li>Let the model include a schema indicating that   elements tagged F must have as content an integer less than 5.</li>
<li>Declare a repeat that binds to the children of E and  creates an output for each.</li>
<li>Write ECMAScript that adds two F child nodes to E,  then invokes rebuild(), recalculate(), revalidate() and  refresh() on the instance document.</li>
<li>Use a trigger to actuate the ECMAScript.</li>
<li>The test is passed if two new output elements show  up with values 4 and 5, and if the output with value 5  is indicated to be invalid.</li></ul> </li>
<li href="chapter7/7.2-3.xml">Create an instance with nodes A, B, C, D.  Let C have a calculate if(A &lt; B, D + 1, D). Create  an ECMAScript that modifies only D, then invokes  recalculate(), revalidate(), refresh(). Test that  the outputs bound to C and D both change. This  proves that a 
<emph>full</emph> recalculate is run  since C is not dependent on what changed (D).</li></nl></section>
<section class="assertion">
<h href="index-all.html#expr-eval" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.3 Evaluation Context</h>
<p class="MUST UA">Every XPath expression must have the evaluation context  defined by XForms. </p>
<nl>
<li href="chapter7/7.3-1.xml">Rule 1: Evaluation context for outermost binding elements,  including a bind element and an output element.</li>
<li href="chapter7/7.3-2.xml">Rule 2: Evaluation context for non-outermost binding elements,  including a nested bind element and an output element  inside a group element.</li>
<li href="chapter7/7.3-3.xml">Rule 3: Define three XForms models identified as M1, M2 and M3 in  document order. Create three outputs, the first  with no model attribute, the second with a model of  M2 and the third with no model attribute but within  a group that has a model of M3. Bind each output  to the root instance element, and set the content  of the instance element equal to the model number  (1, 2 or 3). The test is passed if the respective  outputs display 1, 2 and 3.</li>
<li href="chapter7/7.3-4.xml">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=&quot;Line/Subtotal&quot; and   calculate=&quot;../Units * ../Price&quot;.   Use a repeat to create an output for each Subtotal in  the instance. Ensure each Subtotal becomes equal to  the product of its sibling element Units and Price.    NOTE: RULE IS INCORRECT; IT SHOULD SAY 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.</li>
<li href="chapter7/7.3-5.xml">Rule 5: Create an instance whose root element  contains three children. Write a bind that attaches to  all the children and assigns a calculate of position()+last().  Bind outputs to each child and ensure that the outputs  display 4, 5 and 6. The last() is uniformly 3 and the  position() varies from 1 to 3. NOTE: SPEC IS INCORRECT;  IT SHOULD SAY THAT THE POSITION IS PROPERLY SET, NOT THAT IT IS   UNIFORMLY 1.</li>
<li href="">Rule 6: NO TEST.</li>
<li href="">Rule 7: Tested in 7.11 Extension Functions</li>
<li href="chapter7/7.3-8.xml">Rule 8: Create an instance whose Root element node  declares a default namespace of http://example.org.  Create a bind element that declares xmlns:ex to  be equal to http://example.org and which assigns  readonly of true() to the ex:Root element. Create an  input control that declares xmlns:ex again and also  binds to ex:Root. Ensure that the input control is read only.</li></nl></section>
<section class="assertion">
<h href="index-all.html#expr-binding-expression" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.4 Bind Expressions</h>
<p class="MUST UA">Binding expressions that vary based on changes of instance  data structure (i.e. are &quot;fixed&quot;) report correct values.  NOTE: THE SPEC INCORRECTLY RESTRICTS TO LOCATIONPATH, BUT  MULTIPLE INSTANCES DO NOT WORK IF THIS IS THE CASE. </p>
<nl>
<li href="chapter7/7.4.xml">Binding expressions tests of position(), last(), count(),   index() and property() before and after inserting a new  node into instance data.</li></nl></section>
<section class="assertion">
<h href="index-all.html#expr-model-binding-expression" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.4.1 Model Binding Expressions</h>
<p class="MUST UA">XForms processor must dispatch xforms-binding-exception and terminate  when a dynamic dependency is detected in a model binding expression. </p>
<nl>
<li href="chapter7/7.4-1.xml">Create an instance containing two 'message' elements  with 'for' attributes having different values. Create a  third element whose calculation obtains the value of   the first message based on matching its 'for' attribute value  (e.g. calculate='message[@for=&quot;Roland&quot;]'). Use setvalue()  action to change values of the two 'for' attributes such that  the first message has a 'for' attribute of &quot;John&quot; and the  second message has a 'for' attribute of &quot;Roland&quot;.   The xforms-binding-exception must be dispatched.</li></nl></section>
<section class="assertion">
<h href="index-all.html#id2630183" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.4.2 UI Binding Expressions</h>
<p class="MUST UA">XForms full processor MUST support dynamic dependencies in  UI binding expressions. </p>
<nl>
<li href="chapter7/7.4-2.xml">Create an input control whose ref contains  a value test in a predicate   (e.g. ref='message[@for=&quot;Roland&quot;]').</li></nl></section>
<section class="assertion">
<h href="index-all.html#expr-lib" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">7.5 XForms Core Function Library</h>
<p class="MUST UA">All XForms-specific functions MUST be implemented. (The  functions are grouped by return type in Sections 7.6 through  7.10) </p>
<nl>
<li href="chapter7/7.6.xml">7.6 Boolean Methods</li>
<li href="chapter7/7.7.xml">7.7 Number Methods</li>
<li href="chapter7/7.8.xml">7.8 String Methods</li>
<li href="chapter7/7.9.xml">7.9 Date and Time Functions</li>
<li href="chapter7/7.10.xml">7.10 Node-set Functions</li></nl></section>
<section class="assertion" xml:base="http://www.w3.org/MarkUp/Forms/Group/Drafts/Sources/">
<h href="index-all.html#expr-extension">7.11 Extension Functions</h>
<p class="MUST UA">If additional XPath functions are specified in the functions   attribute of the model element, then the functions MUST be  available to XPath expressions. </p>
<nl>
<li href="">Tested in Section 3.3.1 The model Element</li></nl></section></section></body></html>
