<?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>!-- TBD: Place the test case title here</title>
		<xforms:model>
			<xforms:instance>
				<instance xmlns="">
					<a>a</a>
					<b>b</b>
					<initcount>0</initcount>
				</instance>
			</xforms:instance>
			<xforms:message level="modal" ev:event="xforms-ui-initialize">ui-initialize</xforms:message>
		</xforms:model>
	</head>
	<body>
		<h>xforms-ui-initialize</h>
		<p>Assertions tested by this test case:</p>
		<nl>
			<li>Assertion 4.2.4-1</li>
		</nl>
		<p>
    	xforms-ui-initialize processing dispatches xforms-form-control-initialize 
    	
    	if all ui elements are formcontrol initcount should be 4
    	if not initcount should be 2
    </p>
		<xforms:group>
			<xforms:input ref="a">
				<xforms:label>input</xforms:label>
				<xforms:setvalue ref="initcount" value="initcount+1" ev:event="xforms-form-control-initialize"/>
			</xforms:input>
			<xforms:input ref="b">
				<xforms:label ref=".">
					<xforms:setvalue ref="/instance/initcount" value="initcount+1" ev:event="xforms-form-control-initialize"/>
				</xforms:label>
				<xforms:setvalue ref="/instance/initcount" value="initcount+1" ev:event="xforms-form-control-initialize"/>
			</xforms:input>
			<xforms:setvalue ref="/instance/initcount" value="initcount+1" ev:event="xforms-form-control-initialize"/>
		</xforms:group>
		<xforms:group><xforms:output ref="/instance/initcount/"><xforms:label>initcount</xforms:label></xforms:output>
		</xforms:group>
	</body>
</html>
